what is the output for this question:
main()
{
int i=1;
printf("%d%d%d",i,i++,++i);
}
Answer Posted / r.aruna
answer is 3,2,2
because print the value form right to left.
so,the first one ++i means preincrement.
so,incremented one,2
second one is i++ means postincrement .
it doesn't increment store in same location
but next i means 3.because move to next location
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
Under what circumstances does a name clash occur?
why do some people write if(0 == x) instead of if(x == 0)?
Write a program that takes a 5 digit number and calculates 2 power that number and prints it(should not use big integers and exponential functions)
If a variable is a pointer to a structure, then which operator is used to access data members of the structure through the pointer variable?
What is the right type to use for boolean values in c? Is there a standard type? Should I use #defines or enums for the true and false values?
how to capitalise first letter of each word in a given string?
Explain what is the benefit of using #define to declare a constant?
Is flag a keyword in c?
Why we use stdio h in c?
What does the message "automatic aggregate intialization is an ansi feature" mean?
Why is not a pointer null after calling free? How unsafe is it to use (assign, compare) a pointer value after it is been freed?
Can a function argument have default value?
The file stdio.h, what does it contain?
Why we use void main in c?
Where does the name "C" come from, anyway?