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



WHAT WILL BE THE OUTPUT OF THE FOLLOWING QUESTION void main() { int x=4,y=3,z; z=x-- -y; printf..

Answer / sampath alagappan

3,3,0

Is This Answer Correct ?    2 Yes 0 No

WHAT WILL BE THE OUTPUT OF THE FOLLOWING QUESTION void main() { int x=4,y=3,z; z=x-- -y; printf..

Answer / manikanta

x=3,y=3,z=1

Is This Answer Correct ?    1 Yes 1 No

WHAT WILL BE THE OUTPUT OF THE FOLLOWING QUESTION void main() { int x=4,y=3,z; z=x-- -y; printf..

Answer / arunkumar

it will be 3,3,1
no doubt it is the correcct one..
if anybody have a doubt compile and execute it with turbo c.

Is This Answer Correct ?    0 Yes 0 No

WHAT WILL BE THE OUTPUT OF THE FOLLOWING QUESTION void main() { int x=4,y=3,z; z=x-- -y; printf..

Answer / monika thakur

3,3,1

Is This Answer Correct ?    0 Yes 0 No

WHAT WILL BE THE OUTPUT OF THE FOLLOWING QUESTION void main() { int x=4,y=3,z; z=x-- -y; printf..

Answer / jasmeet singh

hey i typed the output of x=4 but its 3. coz after the
decrement now its value is 3.

Is This Answer Correct ?    4 Yes 5 No

WHAT WILL BE THE OUTPUT OF THE FOLLOWING QUESTION void main() { int x=4,y=3,z; z=x-- -y; printf..

Answer / ramya b.m

The output will be 3 3 1. initially the value of x is 4 and
subtracting it with value of y which is 3 the difference is
1. while printing the value of x is decremented by 1 and
hence the output 3 3 1.

Is This Answer Correct ?    1 Yes 2 No

WHAT WILL BE THE OUTPUT OF THE FOLLOWING QUESTION void main() { int x=4,y=3,z; z=x-- -y; printf..

Answer / venkat

The output will be 331
this is so because while assigning x -y is assinged to z..
so z=4-3=1
then the value of x will be decremented { post decrement }
now the value of x will be 4-1 = 3
so while printing
x = 3
y = 3{no change}
z= 1

Is This Answer Correct ?    1 Yes 2 No

WHAT WILL BE THE OUTPUT OF THE FOLLOWING QUESTION void main() { int x=4,y=3,z; z=x-- -y; printf..

Answer / tommy tom

331

x = 4-- = 3
y = 3
z = 1

then, when printing, there are no spaces in the "%d%d%d" format string, thus there are no spaces in the printing of the numbers. Also, at the end of the run, the command prompt will be tacked onto the end of the output, as the format string contains no newlines, line returns, or other reasons to assume a nice printing.

Is This Answer Correct ?    1 Yes 2 No

WHAT WILL BE THE OUTPUT OF THE FOLLOWING QUESTION void main() { int x=4,y=3,z; z=x-- -y; printf..

Answer / guru1985

#include<stdio.h>
#include<conio.h>
void main()
{
int x=4,y=3,z;
z=x-- -y;
printf("x=%d\ny=%d\nz=%d",x,y,z);
}
Output=>
x=3
y=3
z=1

Is This Answer Correct ?    0 Yes 3 No

WHAT WILL BE THE OUTPUT OF THE FOLLOWING QUESTION void main() { int x=4,y=3,z; z=x-- -y; printf..

Answer / geetha.s.b

4,3,1

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More C C++ Errors Interview Questions

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

2 Answers   TCS,


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 .

2 Answers  


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.

2 Answers   HCL,


void main() { int i=7; printf("N= %*d",i,i); }

6 Answers   HCL,


How to create a program that lists the capital country when told what the original country is? (Terribly sorry, I'm a novice programmer and would appreciate any help ;). Cheers, Alexxis

0 Answers  






void main() { int i=5; printf("%d",i+++++i); }

14 Answers   HCL,


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  


What are the different types of errors in C and when they occur?

4 Answers  


what is the error in the following code: main() { int i=400,j; j=(i*i)/i; }

4 Answers  


how to convert decimal to hexadecimal without using arrays just loops

2 Answers  


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.

5 Answers   CMC,


quoroum of computer languages?

0 Answers   Infosys,


Categories