WHAT WILL BE THE OUTPUT OF THE FOLLOWING QUESTION
void main()
{
int x=4,y=3,z;
z=x-- -y;
printf("%d%d%d",x,y,z);
}
Answers were Sorted based on User's Feedback
Answer / jasmeet singh
when assigning value to z, x is used with a "post"
decrement. so the original value for the x i.e. 4 is taken
for the calculation and then the decrement is done.
so answer is
4,3,1
Is This Answer Correct ? | 3 Yes | 15 No |
Answer / sandhya
the answer is
4 3 1
because
we have already asigned vale to x&y in begning so directly it will print 4 for x & 3 for y it becomes 3-2=1
Is This Answer Correct ? | 3 Yes | 29 No |
void main() { int i=5,y=3,z=2,ans; clrscr(); printf("%d",++i + --z + i++ + --i * ++y); i=5,y=3,z=2; ans=++i + --z + i++ + --i * ++y; printf("\n%d",ans); getch(); } Its output is 37 and 31.... Please explain me why its different How it works.....
what is exceptions?
Find the error (2.5*2=5) (a) X=y=z=0.5,2.0-5.75 (b) s=15;
Given an int variable n that has already been declared and initialized to a positive value, and another int variable j that has already been declared, use a do...while loop to print a single line consisting of n asterisks. Thus if n contains 5, five asterisks will be printed. Use no variables other than n and j .
errors are known as?
3 Answers EX, State Bank Of India SBI,
How to reverse a linked list without using array & -1? Thank you.
How to convert hexadecimal to binary using c language..
1 Answers Bajaj, GAIL, Satyam, Zenqa,
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); }
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.
full c programming error question based problem
printy(a=3,a=2)
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.)