#include<stdio.h>
void main()
{
int i=1;
printf("%d%d%d",i++,++i,i);
}
Answers were Sorted based on User's Feedback
Answer / vinod
3 2 1.because the print f function print right to leftand
the compiler reads left to right.thus answer is 3 2 1
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / shruti
the answer will be:-
1,3,3
as i++ is postfix so first it will print the value then
increament..
after first increament the second preincreament comes and
the value becomes 3..
third time also it will 3..
Is This Answer Correct ? | 4 Yes | 5 No |
Answer / aaradhana
1,2,2
since to print the postincremented value then i takes the
value 1 then gets preincremented by1 & takes i=2.To print i
value then it takes the updated value i=2.
Is This Answer Correct ? | 1 Yes | 3 No |
Answer / ramya
Answer is 133.
first the compiler prints 'i' value and prints the value,
next it increments the 'i' value and then prints its value.
Is This Answer Correct ? | 8 Yes | 14 No |
Answer / priyadarshan kasta
1 2 2
becoz, this line will execute frm right to left side.
that is, first i=1, then ++i will be 2 and then i++ will be
printed as 2. So , it will print as 1 2 2(i.e i++,++i,i)
Is This Answer Correct ? | 1 Yes | 10 No |
What is the code for following o/p * * * * * * * * * * * * * * * *
void main() { int i=7; printf("N= %*d",i,i); }
class test { int a; public: test(int b):a(b){} void show(){ cout<<a; } }; void main() { test t1; test t2(5); t1.show(); t2.show(); } }
loop1: { x=i<n?(i++):0; printf("%d",i); exit(x); continue; } Error- misplaced continue. Doubt-1.will the exit(x) be executed for all values of x 2.will this statement go out of the program.
Assume that the int variables i and j have been declared, and that n has been declared and initialized. Write code that causes a "triangle" of asterisks of size n to be output to the screen. Specifically, n lines should be printed out, the first consisting of a single asterisk, the second consisting of two asterisks, the third consistings of three, etc. The last line should consist of n asterisks. Thus, for example, if n has value 3, the output of your code should be * ** *** You should not output any space characters. Hint: Use a for loop nested inside another for loop.
Write a c-programe that input one number of four digits and find digits sum?
which typw of errors ? & how to solve it ?
UINT i,j; i = j = 0; i = ( i++ > ++j ) ? i++ : i--; explain pls....
what is macro in c? Difference between single linked list & double linked list what is fifo & lifo? what is stack & queue?
Using string functions write a program that will accept the name of the capital as input value and will display the corresponding country. ------------------------ Capitals Countries ------------------------ Capitals Countries Ottawa Canada Moscow Russia Rome Italy I can't not get it to run properly
quoroum of computer languages?
What is the out put of this programme? int a,b,c,d; printf("Enter Number!\n"); scanf("%d",&a); while(a=!0) { printf("Enter numbers/n"); scanf("%d%d%d",&b,&c,&d); a=a*b*c*d; } printf("thanks!"); getche(); Entering numbers are a=1,b=2,c=3,d=4 b=3,c=4,d=-5 b=3,c=4,d=0