what is the output of the following program?
#include<stdio.h>
void main()
{
int x=4,y=3,z;
z=x-- -y;
printf("\n%d %d %d",x,y,z);
}
Answers were Sorted based on User's Feedback
Answer / poorna
Ans:3 3 1
bcoz
z=4-- -3; z=4-3;
z=1;
and x=3
there fore answer is 3 3 1
| Is This Answer Correct ? | 42 Yes | 5 No |
Answer / ravi chandra
x=4
y=3
z=x-- -y;
x-- means at first the left hand value will be equal to x
i.e., z=x and then the value of x gets decrement..
z=x-- -y
z=4-- -3
z=4-3 and x=x-1
z=1 and x=3
the y value remains same y=3
therefore x=3 y=3 and z=1
| Is This Answer Correct ? | 9 Yes | 0 No |
What is %lu in c?
How a string is stored in c?
What is diffrance between declaration and defination of a variable or function
How can I do peek and poke in c?
Where are local variables stored in c?
#include<stdio.h> main() { char s1[]="Ramco"; char s2[]="Systems"; s1=s2; printf("%s",s1); } Find the output
What is a nested loop?
I have seen function declarations that look like this
Dont ansi function prototypes render lint obsolete?
What is floating point constants?
1. main() { printf("%d",printf("HelloSoft")); } Output?
Can we change the value of static variable in c?