main()
{
int i=_l_abc(10);
printf("%d\n",--i);
}
int _l_abc(int i)
{
return(i++);
}
Answers were Sorted based on User's Feedback
Answer / susie
Answer :
9
Explanation:
return(i++) it will first return i and then increments. i.e.
10 will be returned.
Is This Answer Correct ? | 7 Yes | 1 No |
Post increment - perform operation first , then increment
In function call _l_abc its post increment, so after value 10 to be returned is decided , local variable i is increment , its i in function.
Variable i in _l_abc is different than i in main.
Post decrement : decrement first then perform operation.
In main its pre decrement , returned 10 is decremented to 9, then printed.
Now , unless compiler does not throw error of beginning function name with _ , 9 is printed.
Is This Answer Correct ? | 1 Yes | 1 No |
plz tell me the solution.......... in c language program guess any one number from 1 to 50 and tell that number within 8 asking question in yes or no...............
void main() { if(~0 == (unsigned int)-1) printf(“You can answer this if you know how values are represented in memory”); }
How to use power function under linux environment.eg : for(i=1;i<=n;i++){ pow(-1,i-1)} since it alerts undefined reference to 'pow'.
main() { char * strA; char * strB = I am OK; memcpy( strA, strB, 6); } a. Runtime error. b. I am OK c. Compile error d. I am O
Is the following statement a declaration/definition. Find what does it mean? int (*x)[10];
PROG. TO PRODUCE 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1
#define clrscr() 100 main() { clrscr(); printf("%d\n",clrscr()); }
main() { int i=10; i=!i>14; Printf ("i=%d",i); }
main(int argc, char *argv[]) { (main && argc) ? main(argc-1, NULL) : return 0; } a. Runtime error. b. Compile error. Illegal syntax c. Gets into Infinite loop d. None of the above
How we print the table of 2 using for loop in c programing?
int i=10; main() { extern int i; { int i=20; { const volatile unsigned i=30; printf("%d",i); } printf("%d",i); } printf("%d",i); }
#include <stdio.h> int main(void) { int a=4, b=2; a=b<<a+b>>2 ; printf("%d",a); return 0; }