20. main()
{
int i=5;
printf("%d%d%d%d%d%d",i++,i--,++i,--i,i);
}
Answer:??????
Answers were Sorted based on User's Feedback
Answer / ashish
The only concept here is that the printf starts 'generating'
results from RHS to LHS.
Hence, in the process of generation: i=5; then --i=4; ++i=5;
i--=5(due to the postfix concept, but after finishing this
calculation i=4); now i++=4(after performing i++, the value
of 'i' is 5, but for printing, due to the postfix concept,
i=4, the current value of 'i' will be printed).
The printing happens in order from LHS to RHS. Hence these
values are printed as 4 5 5 4 5.
Is This Answer Correct ? | 5 Yes | 1 No |
Why the below program throughs error during compilation? #include<stdio.h> #include<conio.h> enum { ZERO, ONE, TWO, }; main() { printf("%d",&TWO); getch(); }
What is binary tree in c?
Is multithreading possible in c?
What is the difference between procedural and functional programming?
Explain About fork()?
Given two strings S1 and S2. Delete from S2 all those characters which occur in S1 also and finally create a clean S2 with the relevant characters deleted.
Is return a keyword in c?
Explain how can I pad a string to a known length?
#include<std.h> int main() { char *str[]={"Frogs","Do","Not","Die","They","Croak!"}; printf("%d %d\n",sizeof(str),strlen(str)); ...return 0; } what will the output of the above program?
coding for Fibonacci.?
How can I recover the file name given an open stream or file descriptor?
How many bytes are occupied by near, far and huge pointers (dos)?