void main()
{
int i=1;
printf("%d%d%d",i,++i,i++);
}
Cau u say the output....?
Answers were Sorted based on User's Feedback
Answer / subash
221
because it starts executing from right to left
so it first executes i++(the increment will happen when
entire printf statement is executed so now ++i which means
it is the pre incremant so now i becomes 2
| Is This Answer Correct ? | 2 Yes | 3 No |
Answer / kiran
The output will be 1 2 2...
First the assigned value of i(1) is printed. Then (++i) prints the Incremented value of i which is 2 will be printed.
Now as the Postfix operator only prints thhe value first and then increments...so the value of i is again 2..
| Is This Answer Correct ? | 4 Yes | 5 No |
Answer / we r the new inventors
the explanation above are also correct but think they are somewhat wrong because it was post increment of i.so value of i will become 2..
| Is This Answer Correct ? | 1 Yes | 2 No |
Answer / we are the new inventors
above answers are also right but i think they are somewhat wrong..because its a post increment of i so ans will become 2...
| Is This Answer Correct ? | 0 Yes | 1 No |
Answer / sums
The ans is obv 3 3 1...
The explanations given are also correct
For all those u r giving other answers without even giving the reason should at least run the program in "gcc" before writing anything
| Is This Answer Correct ? | 2 Yes | 4 No |
Answer / pratik
answer is 1 1 2 ..
it is an example of stack type ..
| Is This Answer Correct ? | 0 Yes | 4 No |
How to convert hexadecimal to binary using c language..
1 Answers Bajaj, GAIL, Satyam, Zenqa,
what is macro in c? Difference between single linked list & double linked list what is fifo & lifo? what is stack & queue?
Declaration of Cube Guys please help me.. Is this a right way to declare cube.? If i Compile it. It Says: Cube undeclared what should i do? Please help \thanks in advanced #include<stdio.h> #include<math.h> #include<conio.h> main( ) { float x,y; while(x++<10.0) { printf("Enter Number:"); scanf("%d", &x); y = cube(x); printf("%f %f %f \n", x,pow(x,2),y); cube(x); } { float x; float y; y = x*x*x; } getch(); return (y); }
To generate the series 1+3+5+7+... using C program
What is probability to guarantee that the task a programmer is going to create will be created and be able to run on a particular system (RTOS/GPOS).
Answering Yes or No in C++...using only stdio.h and conio.h..........help me please...? here's must be the output of the program: Screen A Exam No. items Score 1 20 20 2 35 35 Another Entry? [Y] or [N] : Screen B: Record No. Student's Name: 1 Fernando Torres 2 Chuck Norris Note: if you press Y, the program must repeat the procedure in screen A, then if N, the program must proceed to the screen B....Please Help me out............
#include"stdio.h" #include"conio.h" void main() { int a; printf("\n enter a number:"); scanf("%c\n"); getch(); }
difference between c/c++ programing language? what is necessesity of c++ when existing c programing language?
Write a program to accept two strings of Odd lengths. Then take all odd characters from one string and even characters from the other and concatenate and produce a string.
How to create a program that lists countries capitals when country is entered? (Terribly sorry, I'm a complete novist to coding with C, am looking for inspiration and general tips on how to code and create this program.)
How to reverse a linked list without using array & -1? Thank you.
How to upgrade LOOP environment, I just mean, how can i make loop statement editable ? I just try some program using loop statement and checking it in multiple compilers. Every compiler showing different output, what's the wrong ? is it a compiler based problem, or loop based problem, tell me why ? and what will be the debugging process, for this kind of problem ?