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 / 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 |
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 |
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 |
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 |
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 |
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 |
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
what is meant by linking error? how can i solve it? if there is a linking error " unable to open file 'cos.obj'? then what should i do?
how to convert decimal to hexadecimal without using arrays just loops
write a profram for selection sort whats the error in it?
void main() { for(int i=0;i<5;i++); printf("%d",i); } What is the output?..
32 Answers College School Exams Tests, CTS, HCL, iGate, SmartData,
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 .
difference between c/c++ programing language? what is necessesity of c++ when existing c programing language?
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.)
wap for bubble sort
what are the techniques for reducing the fragility of a memory bug?
main() { char c; for(c='A';c<='Z';c++) getch(); }
what is the error in the following code: main() { int i=400,j; j=(i*i)/i; }