Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged programming-in-c
0
votes
2
answers
1741
Is the following code legal?
void main() { typedef struct a aType; aType someVariable; struct a { int x; aType *b; }; }
void main() { typedef struct a aType; aType someVariable; struct a { int x; aType *b; }; }
Desert_Warrior
647
views
Desert_Warrior
asked
May 15, 2016
Programming in C
programming-in-c
test-series
+
–
0
votes
1
answer
1742
C programming \ predict the ouptput
void main() { int i=10, j=2; int *ip= &i, *jp = &j; int k = *ip/*jp; printf(“%d”,k); }
void main() { int i=10, j=2; int *ip= &i, *jp = &j; int k = *ip/*jp; printf(“%d”,k); }
Desert_Warrior
654
views
Desert_Warrior
asked
May 15, 2016
Programming in C
programming-in-c
pointers
+
–
0
votes
1
answer
1743
Type casting
Sourabh Kumar
970
views
Sourabh Kumar
asked
May 13, 2016
Programming in C
programming-in-c
+
–
0
votes
1
answer
1744
Type casting
K is int type K=2.0/9; What k will print? In let us c they give that k final value is 0.0 But I think it's value is 0
K is int typeK=2.0/9;What k will print? In let us c they give that k final value is 0.0But I think it's value is 0
Sourabh Kumar
524
views
Sourabh Kumar
asked
May 13, 2016
Programming in C
programming-in-c
+
–
0
votes
2
answers
1745
C programming\ predict-the-output
main() { printf("%x",-1<<4); }
main() { printf("%x",-1<<4); }
Desert_Warrior
248
views
Desert_Warrior
asked
May 9, 2016
Programming in C
programming-in-c
+
–
0
votes
1
answer
1746
C switch statement predict the output
main() { int i=3; switch(i) { default:printf("zero"); case 1: printf("one"); break; case 2:printf("two"); break; case 3: printf("three"); break; } }
main() { int i=3; switch(i) { default:printf("zero"); case 1: printf("one"); break; case 2:printf("two"); break; case 3: printf("three"); break; } }
Desert_Warrior
897
views
Desert_Warrior
asked
May 9, 2016
Programming in C
programming-in-c
+
–
1
votes
2
answers
1747
C programming
Assume that the size of an integer is 4 bytes. Predict the output? #include <stdio.h> int fun() { puts(" Hello "); return 10; } int main() { printf("%d", sizeof(fun())); return 0; }
Assume that the size of an integer is 4 bytes. Predict the output?#include <stdio.h int fun() { puts(" Hello "); return 10; } int main() { printf("%d", sizeof(fun())); re...
Desert_Warrior
2.8k
views
Desert_Warrior
asked
May 7, 2016
Programming in C
programming-in-c
+
–
1
votes
1
answer
1748
UGC NET CSE | June 2013 | Part 3 | Question: 48
When an array is passed as a parameter to a function which of the following statements is correct? The function can values in the original array The function cannot values in the original array Results in compilation error Results in run-time error
When an array is passed as a parameter to a function which of the following statements is correct?The function can values in the original arrayThe function cannot values ...
im.raj
2.0k
views
im.raj
asked
May 6, 2016
Programming in C
ugcnetcse-june2013-paper3
programming-in-c
array
+
–
0
votes
1
answer
1749
Which of the following is not a member of a class ?
A. Static function B. Friend Function C. Const Function D. Virtual function
A. Static functionB. Friend FunctionC. Const FunctionD. Virtual function
im.raj
57.1k
views
im.raj
asked
May 6, 2016
Programming in C
programming-in-c
programming
+
–
1
votes
1
answer
1750
What does the following expressions means?
char *(*(* a[N])())(); Can somebody explain this for me? How to read this?
char *(*(* a[N])())();Can somebody explain this for me? How to read this?
im.raj
583
views
im.raj
asked
May 6, 2016
Programming in C
programming-in-c
+
–
8
votes
4
answers
1751
ISRO-2013-63
Consider the following $C$ code. #include <stdio.h> #include <math.h> void main () { double pi = 3.1415926535; int a = 1; int i; for (i=0; i < 3; i++) if (a = cos(pi * i/2)) printf("% d", 1); else printf("%d", 0); } What would the program print? $000$ $010$ $101$ $111$
Consider the following $C$ code.#include <stdio.h #include <math.h void main () { double pi = 3.1415926535; int a = 1; int i; for (i=0; i < 3; i++) if (a = cos(pi * i/2))...
makhdoom ghaya
6.4k
views
makhdoom ghaya
asked
May 5, 2016
Programming in C
isro2013
programming-in-c
identify-function
output
+
–
0
votes
1
answer
1752
UGC NET CSE | September 2013 | Part 3 | Question: 54
A program contains the following declarations and initial assignments. int i=8, j=5; double x =0.005, y=-0.1; char c=’c’, d=’d’; Determine the value of the following expressions which involve the use of library functions: abs(1-2*j); log(exp(x)); toupper(d) 2; 0.005; D 1; 0.005; D 2; 0.005; E 1; 0.005; e
A program contains the following declarations and initial assignments.int i=8, j=5;double x =0.005, y=-0.1;char c=’c’, d=’d’;Determine the value o...
Sanjay Sharma
1.6k
views
Sanjay Sharma
asked
May 3, 2016
Programming in C
ugcnetcse-sep2013-paper3
programming-in-c
+
–
46
votes
4
answers
1753
GATE CSE 2012 | Question: 49
Consider the following C code segment. int a, b, c = 0; void prtFun(void); main() { static int a = 1; /* Line 1 */ prtFun(); a += 1; prtFun(); printf( \n %d %d , a, b); } void prtFun(void) { static int a = 2; /* Line 2 */ int b = 1; a += ++b ... $\begin{array}{ll} \text{4} & \text{2} \\ \text{4} & \text{2} \\ \text{2} & \text{0} \\ \end{array}$
Consider the following C code segment.int a, b, c = 0; void prtFun(void); main() { static int a = 1; /* Line 1 */ prtFun(); a += 1; prtFun(); printf(“ \n %d %d ”, a, ...
go_editor
10.2k
views
go_editor
asked
Apr 21, 2016
Programming in C
normal
gatecse-2012
programming-in-c
programming
+
–
0
votes
1
answer
1754
What is the problem with this program?
The following program seg-faults (crashes) when user supplies input as ‘freeze’ while it works fine with input ‘zebra’. Why? #include<stdio.h> int main(int argc, char *argv[]) { char *ptr = (char*) ... printf("\n String contains 'z'\n"); // Do some more processing } free(ptr); } return 0; }
The following program seg-faults (crashes) when user supplies input as ‘freeze’ while it works fine with input ‘zebra’. Why?#include<stdio.h int m...
shivani2010
287
views
shivani2010
asked
Apr 21, 2016
Programming in C
programming-in-c
+
–
0
votes
1
answer
1755
What is the problem with this code?
#include<stdio.h> int main() { char arr[10]; memset(arr,0,sizeof(arr)); gets(arr); printf("\n The buffer entered is [%s]\n",arr); return 0; }
#include<stdio.h int main() { char arr[10]; memset(arr,0,sizeof(arr)); gets(arr); printf("\n The buffer entered is [%s]\n",arr); return 0; }
shivani2010
300
views
shivani2010
asked
Apr 21, 2016
Programming in C
programming-in-c
+
–
0
votes
2
answers
1756
What will be the output, Please explain?
void f(int n){ if(n <= 1){ printf("%d", n); } else{ f(n/2); printf("%d", n%2); } }
void f(int n){ if(n <= 1){ printf("%d", n); } else{ f(n/2); printf("%d", n%2); } }
shivani2010
520
views
shivani2010
asked
Apr 18, 2016
Programming in C
programming-in-c
functions
+
–
0
votes
1
answer
1757
Valid pointer operation
The valid pointer operation is assigning or comparing to zero in C Can anyone explain this statement?
The valid pointer operation is assigning or comparing to zero in CCan anyone explain this statement?
Beyonder
665
views
Beyonder
asked
Apr 16, 2016
Programming in C
programming-in-c
programming
+
–
4
votes
2
answers
1758
Scope
Dexter
2.1k
views
Dexter
asked
Apr 12, 2016
Compiler Design
programming-in-c
variable-scope
made-easy-booklet
+
–
0
votes
2
answers
1759
What is the output of the program ?
#include<stdio.h> int main() { printf("%c\n", 7["IndiaBIX"]); return 0; } Please explain how the output is X ? I know while counting in Array will make X . But how this CODE works.........>>?
#include<stdio.h int main() { printf("%c\n", 7["IndiaBIX"]); return 0; } Please explain how the output is X ? I know while counting in Array will make X . But how this CO...
pC
1.1k
views
pC
asked
Apr 8, 2016
Programming in C
programming-in-c
output
+
–
0
votes
1
answer
1760
garbage collection
Why C language does not provide heap or garbage collection ?? Is there any higher level mechanism??
Why C language does not provide heap or garbage collection ?? Is there any higher level mechanism??
ManojK
562
views
ManojK
asked
Apr 5, 2016
Programming in C
programming-in-c
+
–
0
votes
3
answers
1761
programing
int main(){ int a; a = 1; while(a-- >= 1) while(a-- >= 0); printf("%d", a); }
int main(){ int a; a = 1; while(a >= 1) while(a >= 0); printf("%d", a); }
Registered user 7
576
views
Registered user 7
asked
Apr 4, 2016
Programming in C
programming-in-c
loop
+
–
0
votes
1
answer
1762
C Programming doubt
What is the difference between struct node* head= NULL and struct node* head= (struct node*)NULL ?
What is the difference between struct node* head= NULL and struct node* head= (struct node*)NULL ?
UK
699
views
UK
asked
Mar 25, 2016
Programming in C
programming-in-c
structure
pointers
+
–
1
votes
3
answers
1763
C pointer doubt
What is the difference when I write in program mynode * head; add_node(&head,10); add_node( struct node ** head, into value); To this mynode *head; add_node (head,10); add_node( struct node* head, into value) Which is the correct way of writing?
What is the difference when I write in program mynode * head; add_node(&head,10); add_node( struct node head, into value);To this mynode *head; add_node (head,10); add_...
UK
715
views
UK
asked
Mar 15, 2016
Programming in C
programming-in-c
pointers
+
–
1
votes
1
answer
1764
Output of c program
void fun(int *p) { int q = 10; p = &q; } int main() { int r = 20; int *p = &r; fun(p); printf("%d", *p); return 0; }
void fun(int *p) { int q = 10; p = &q; } int main() { int r = 20; int *p = &r; fun(p); printf("%d", *p); return 0; }
bad_engineer
8.8k
views
bad_engineer
asked
Mar 13, 2016
Programming in C
programming-in-c
barc2016
pointers
+
–
1
votes
1
answer
1765
Output and please explain
#include<stdio.h> int main() { char *s = "Geeks Quiz"; int n = 7; printf("%.*s", n, s); return 0; }
#include<stdio.h>int main(){char *s = "Geeks Quiz";int n = 7;printf("%.*s", n, s);return 0;}
Sandip Shaw
2.5k
views
Sandip Shaw
asked
Feb 25, 2016
Programming in C
programming-in-c
pointers
array
+
–
0
votes
1
answer
1766
Why are constant variables considered to be as lvalue ?
when constant type variables cannot be modified then why do we consider them as lvalues , why not only r-values ?
when constant type variables cannot be modified then why do we consider them as lvalues , why not only r-values ?
radha gogia
566
views
radha gogia
asked
Feb 23, 2016
Programming in C
programming-in-c
+
–
44
votes
11
answers
1767
GATE CSE 2016 Set 1 | Question: 35
What will be the output of the following $C$ program? void count (int n) { static int d=1; printf ("%d",n); printf ("%d",d); d++; if (n>1) count (n-1); printf ("%d",d); } void main(){ count (3); } $3 \ 1 \ 2 \ 2 \ 1 \ 3 \ 4 \ 4 \ 4$ $3 \ 1 \ 2 \ 1 \ 1 \ 1 \ 2 \ 2 \ 2$ $3 \ 1 \ 2 \ 2 \ 1 \ 3 \ 4$ $3 \ 1 \ 2 \ 1 \ 1 \ 1 \ 2$
What will be the output of the following $C$ program?void count (int n) { static int d=1; printf ("%d",n); printf ("%d",d); d++; if (n>1) count (n-1); printf ("%d",d); } ...
Sandeep Singh
15.6k
views
Sandeep Singh
asked
Feb 12, 2016
Programming in C
gatecse-2016-set1
programming-in-c
recursion
normal
+
–
30
votes
1
answer
1768
GATE CSE 2016 Set 1 | Question: 34
The following function computes the maximum value contained in an integer array $P[ \ ]$ of size $n$ $(n>=1)$. int max (int *p,int n) { int a = 0, b=n-1; while (__________) { if (p[a]<= p[b]) {a = a+1;} else {b = b-1;} } return p[a]; } The missing loop condition is: $a\ \ != n$ $b\ \ != 0$ $b>(a+1)$ $b\ \ != a$
The following function computes the maximum value contained in an integer array $P[ \ ]$ of size $n$ $(n>=1)$. int max (int *p,int n) { int a = 0, b=n-1;...
Sandeep Singh
11.2k
views
Sandeep Singh
asked
Feb 12, 2016
Programming in C
gatecse-2016-set1
programming-in-c
normal
+
–
58
votes
3
answers
1769
GATE CSE 2016 Set 1 | Question: 15
Consider the following C program. # include <stdio.h> void mystery (int *ptra, int *ptrb) { int *temp; temp = ptrb; ptrb =ptra; ptra = temp; } int main () { int a = 2016, b=0, c= 4, d = 42; mystery (&a, &b); if (a < c) mystery (&c, &a); mystery (&a, &d); printf("%d\n", a); } The output of the program is _________.
Consider the following C program.# include <stdio.h void mystery (int *ptra, int *ptrb) { int *temp; temp = ptrb; ptrb =ptra; ptra = temp; } int main () { int a...
Sandeep Singh
18.1k
views
Sandeep Singh
asked
Feb 12, 2016
Programming in C
gatecse-2016-set1
programming-in-c
easy
numerical-answers
parameter-passing
+
–
50
votes
2
answers
1770
GATE CSE 2016 Set 1 | Question: 12
Consider the following "C" program. void f(int, short); void main() { int i = 100; short s = 12; short *p = &s; ____________; // call to f() } Which one of the following expressions , when placed in the blank above, will NOT result in a type checking error? $f(s, *s)$ $i = f(i,s)$ $f(i, *s)$ $f(i, *p)$
Consider the following "C" program.void f(int, short); void main() { int i = 100; short s = 12; short *p = &s; ____________; // call to f() } Which one of the following e...
Sandeep Singh
12.7k
views
Sandeep Singh
asked
Feb 12, 2016
Programming in C
gatecse-2016-set1
programming-in-c
easy
+
–
Page:
« prev
1
...
54
55
56
57
58
59
60
61
62
63
64
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register