f()
{
int a=2;
f1(a++);
}
f1(int c)
{
printf("%d", c);
}
c=?
Answers were Sorted based on User's Feedback
Answer / jack
in line 4, a's value is pushed on to stack and then
increaments.........In line 6 the function f1 pops the a's
value and assigned to c so .......c is value is 2.......
Is This Answer Correct ? | 7 Yes | 2 No |
Answer / viji
a++ is postfix operator so it first assigns its values and
then incremented. In above statement the value of a is first
assigned to c and then increment. so the output of c is 2;
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / banavathvishnu
a value will be first assigned to C in the Function and
latter it will be incremented in f() function.
so the value C remains 2
Is This Answer Correct ? | 0 Yes | 0 No |
a way in which a pointer stores the address of a pointer which stores the value of the target value a) reference b) allocation c) multiple indirection d) none
#define MAX(x,y) (x) > (y) ? (x) : (y) main() { int i = 10, j = 5, k = 0; k = MAX(i++, ++j); printf("%d %d %d", i,j,k); } what will the values of i , j and k? }
14 Answers CDAC, GATE, NDS, TCS,
How do I access command-line arguments?
void main() { //char ch; unsigned char ch; clrscr(); for(ch =0;ch<= 127; ch++) printf(" %c= %d \t ", ch, ch); } output?
How many bytes are occupied by near, far and huge pointers (dos)?
Why doesn't C have nested functions?
difference between native and cross compilers
What is the use of ?: Operator?
what is the output of the following program? #include<stdio.h> void main() { float x=1.1; while(x==1.1) { printf("\n%f",x); x=x-0.1; } }
What will happen when freeing memory twice
What is a pragma?
What is the easiest sorting method to use?