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

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

4 Answers  


what is meant for variable not found?

3 Answers  


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

14 Answers   HCL,


how to convert decimal to binary in c using while loop without using array

50 Answers   Apple, Aptech, Arwen Tech, BCS, C2D Software, CEC,


How to develop a program using C language to convert 8-bit binary values to decimals. TQ

1 Answers   Amazon,






Write down the difference between c. Loop and goto statement d. (!0) and (!1) e. (1= =! 1) and (1!=1) f. NULL and !NULL

0 Answers  


Given an int variable n that has been initialized to a positive value and, in addition, int variables k and total that have already been declared, use a do...while loop to compute the sum of the cubes of the first n whole numbers, and store this value in total . Thus if n equals 4, your code should put 1*1*1 + 2*2*2 + 3*3*3 + 4*4*4 into total . Use no variables other than n , k , and total .

3 Answers  


which typw of errors ? & how to solve it ?

0 Answers  


UINT i,j; i = j = 0; i = ( i++ > ++j ) ? i++ : i--; explain pls....

5 Answers  


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  


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

2 Answers  


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

1 Answers   AMA,


Categories