#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() { char c; int i = 456; clrscr(); c = i; printf("%d", c); } a. 456 b. -456 c. random number d. none of the above
#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); }
typedef struct error{int warning, error, exception;}error; main() { error g1; g1.error =1; printf("%d",g1.error); }
¦void main() ¦{ ¦int i=10,j; ¦ j=i+++i+++i; ¦printf("%d",j); ¦getch(); ¦} ¦ output:-30 but in same question if we write as- ¦void main() ¦{ ¦int i=10; ¦ int j=i+++i+++i; ¦printf("%d",j); ¦getch(); ¦} ¦ output:-33 why output is changed from 30 to 33. Can any body answer...
Write a C program to add two numbers before the main function is called.
void main() { while(1){ if(printf("%d",printf("%d"))) break; else continue; } }
Write a program to check whether the number is prime and also check if it there i n fibonacci series, then return true otherwise return false
struct Foo { char *pName; }; main() { struct Foo *obj = malloc(sizeof(struct Foo)); clrscr(); strcpy(obj->pName,"Your Name"); printf("%s", obj->pName); } a. Your Name b. compile error c. Name d. Runtime error
To Write a C program to remove the repeated characters in the entered expression or in entered characters(i.e) removing duplicates. String contains only lowercase characters ['a'-'z']
Link list in reverse order.
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...............
Is there any difference between the two declarations, 1. int foo(int *arr[]) and 2. int foo(int *arr[2])