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 / sambath

3,3,1

Is This Answer Correct ?    75 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 / shreyas

the answer is 3 3 1..........

while computing value of z ....x will be 4 .....but while
printing its value it has been decremented by 1 and hence x=3.

Is This Answer Correct ?    42 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 / yaswanthraj

Absolutely.. 3 3 1

No doubt in it.....all frnds who said it are right and their
explaination is also correct......

while Z is calculated X is 4...since it is post decrement....

Is This Answer Correct ?    12 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 / amrita mohanty

3,3,1
since it is a post increment operation,so x--=4 initially.
but after that the value of x becomes 3.
x-- - y = 4-3=1
therefore x=3,y=3,z=1

Is This Answer Correct ?    9 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 / viru

3 3 1

Is This Answer Correct ?    5 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 / anjana priyadharshini

THE OUTPUT IS: 3,3,1
THE PEOPLE WHO TOLD THIS ANSWER THEIR EXPLANATION IS CORRECT

Is This Answer Correct ?    5 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 / dinesh

3,3,1

Is This Answer Correct ?    4 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 / medo

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

Is This Answer Correct ?    3 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 / arpit singhal

3,3,1

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 / vishnu

initally x=4,y=3
z=x-- -y;
after doing x-y operation and that value wil be assigned to
z.there followed by x value wil be decreased by 1.
hence z=4-3 z=1
x=4-1 x=3
y=3
hence output will be
3,3,1

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More C C++ Errors Interview Questions

I am using Qt 5.6 during compilation it stops and gives error about Qmake The process "C:QtQt5.6.35.6.3msvc2015_64inqmake.exe" crashed. Error while building/deploying project untitled1 (kit: Desktop Qt 5.6.3 MSVC2015 64bit) When executing step "qmake"

0 Answers  


Given that two int variables, total and amount, have been declared, write a loop that reads integers into amount and adds all the non-negative values into total. The loop terminates when a value less than 0 is read into amount. Don't forget to initialize total to 0. Instructor's notes: This problem requires either a while or a do-while loop.

3 Answers  


what is the large sustained error signal that eventually cause the controller output to drive to its limit

1 Answers   TCS,


full c programming error question based problem

3 Answers   HCL, TCS,


A sample program using data structure? what is file handling?

0 Answers   TCS,






What is the code for following o/p * * * * * * * * * * * * * * * *

1 Answers  


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

2 Answers   Access, Satyam,


printy(a=3,a=2)

3 Answers  


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

4 Answers  


Given that two int variables, total and amount , have been declared, write a sequence of statements that: initializes total to 0 reads three values into amount , one at a time. After each value is read in to amount , it is added to the value in total (that is, total is incremented by the value in amount ). Instructor's notes: If you use a loop, it must be a for loop. And if you use a loop control variable for counting, you must declare it.

1 Answers   Google,


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  


char* f() return "hello:"; void main() {char *str=f(); }

1 Answers  


Categories