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 |
#include<stdio.h> main() { char s[]={'a','b','c','\n','c','\0'}; char *p,*str,*str1; p=&s[3]; str=p; str1=s; printf("%d",++*p + ++*str1-32); }
main() { int k=1; printf("%d==1 is ""%s",k,k==1?"TRUE":"FALSE"); }
why the range of an unsigned integer is double almost than the signed integer.
write a c program to print magic square of order n when n>3 and n is odd?
To reverse an entire text file into another text file.... get d file names in cmd line
write a program in c to merge two array
main() { show(); } void show() { printf("I'm the greatest"); }
C statement to copy a string without using loop and library function..
main() { char a[4]="HELLO"; printf("%s",a); }
enum colors {BLACK,BLUE,GREEN} main() { printf("%d..%d..%d",BLACK,BLUE,GREEN); return(1); }
#include<stdio.h> main() { FILE *ptr; char i; ptr=fopen("zzz.c","r"); while((i=fgetch(ptr))!=EOF) printf("%c",i); }
Sir... please give some important coding questions asked by product companies..