Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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



void main() { int i=1; printf("%d%d%d",i,++i,i++); } Cau u say the output....?..

Answer / shanthi

122

Is This Answer Correct ?    2 Yes 3 No

void main() { int i=1; printf("%d%d%d",i,++i,i++); } Cau u say the output....?..

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

void main() { int i=1; printf("%d%d%d",i,++i,i++); } Cau u say the output....?..

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

void main() { int i=1; printf("%d%d%d",i,++i,i++); } Cau u say the output....?..

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

void main() { int i=1; printf("%d%d%d",i,++i,i++); } Cau u say the output....?..

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

void main() { int i=1; printf("%d%d%d",i,++i,i++); } Cau u say the output....?..

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

void main() { int i=1; printf("%d%d%d",i,++i,i++); } Cau u say the output....?..

Answer / sam

first the initial value of i is 1
i++ is post decremented so,i++ must be 1

final value is " 1 2 1"

Is This Answer Correct ?    1 Yes 3 No

void main() { int i=1; printf("%d%d%d",i,++i,i++); } Cau u say the output....?..

Answer / ramya

OUTPUT:
1,2,1

Is This Answer Correct ?    0 Yes 2 No

void main() { int i=1; printf("%d%d%d",i,++i,i++); } Cau u say the output....?..

Answer / pratik

answer is 1 1 2 ..
it is an example of stack type ..

Is This Answer Correct ?    0 Yes 4 No

void main() { int i=1; printf("%d%d%d",i,++i,i++); } Cau u say the output....?..

Answer / ismail ns

1 1 2

Is This Answer Correct ?    1 Yes 8 No

Post New Answer

More C C++ Errors Interview Questions

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?

2 Answers   TCS,


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); }

2 Answers  


To generate the series 1+3+5+7+... using C program

18 Answers  


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).

0 Answers  


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............

1 Answers  


#include"stdio.h" #include"conio.h" void main() { int a; printf("\n enter a number:"); scanf("%c\n"); getch(); }

12 Answers   HCL,


difference between c/c++ programing language? what is necessesity of c++ when existing c programing language?

2 Answers   TCS,


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.

1 Answers  


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.)

0 Answers  


How to reverse a linked list without using array & -1? Thank you.

2 Answers   Access, Satyam,


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 ?

1 Answers  


Categories