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 |
wap for bubble sort
class test { int a; public: test(int b):a(b){} void show(){ cout<<a; } }; void main() { test t1; test t2(5); t1.show(); t2.show(); } }
void main() { int i=5; printf("%d",i+++++i); }
what is syntax error?
I'm having trouble with coming up with the correct code. Do I need to put a loop? Please let me know if I'm on the right track and what areas I need to correct. I still don't have a good grasp on this programming stuff. Thanks =) The assignment was to write a program using string functions that accepts a coded value of an item and displays its equivalent tag price. The base of the keys: 0 1 2 3 4 5 6 7 8 9 X C O M P U T E R S Sample I/O Dialogue: Enter coded value: TR.XX Tag Price : 68.00
Write a C program to enter 10 integer numbers through one variable and count how many of them are even using while loop ?
How to convert hexadecimal to binary using c language..
1 Answers Bajaj, GAIL, Satyam, Zenqa,
full c programming error question based problem
who was the present cheif governor of reserve bank of india
6 Answers State Bank Of India SBI,
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 .
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.
what is meant for variable not found?