#include<stdio.h>
int main()
{
int a=3,post,pre;
post= a++ * a++ * a++;
a=3;
pre= ++a * ++a * ++a;
printf("post=%d pre=%d",post,pre);
return 0;
}
Answers were Sorted based on User's Feedback
Answer / manish
post= a++ * a++ * a++;
a++ is post increment so 3*3*3=27 and then a is incremented
pre= ++a * ++a * ++a;
++a pre increment
consider ++a * ++a
a incremented two times first result is 5 => 5*5=25
now we have 25 * ++a (a is 5)
a is again incremented (a become 6)
25 * 6 =150 ans
| Is This Answer Correct ? | 7 Yes | 1 No |
main() { int i=4,j=7; j = j || i++ && printf("YOU CAN"); printf("%d %d", i, j); }
void main() { char far *farther,*farthest; printf("%d..%d",sizeof(farther),sizeof(farthest)); }
main() { int i=400,j=300; printf("%d..%d"); }
find simple interest & compund interest
union u { union u { int i; int j; }a[10]; int b[10]; }u; main() { printf("\n%d", sizeof(u)); printf(" %d", sizeof(u.a)); // printf("%d", sizeof(u.a[4].i)); } a. 4, 4, 4 b. 40, 4, 4 c. 1, 100, 1 d. 40 400 4
main() { char *p; p="Hello"; printf("%c\n",*&*p); }
how can i cast a char type array to an int type array
How do you write a program which produces its own source code as its output?
Declare an array of N pointers to functions returning pointers to functions returning pointers to characters?
prog. to produce 1 2 3 4 5 6 7 8 9 10
/*what is the output for*/ void main() { int r; printf("Naveen"); r=printf(); getch(); }
#include <stdio.h> int main(void) { int a=4, b=2; a=b<<a+b>>2 ; printf("%d",a); return 0; }