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 the difference between c and c++?
What are the different types of control structures in programming?
hOW Can I add character in to pointer array of characters char *a="indian"; ie I want to add google after indian in the char *a
Please provide question papers of NATIONAL INFORMATICS CENTRE for Scientific officer
When you call malloc() to allocate memory for a local pointer, do you have to explicitly free() it?
What is the difference between class and object in c?
Is there any book to know about Basics of C Language?
how to use virual function in real time example
How can I implement opaque (abstract) data types in C? What's the difference between these two declarations? struct x1 { ... }; typedef struct { ... } x2;
When would you use a pointer to a function?
Can you assign a different address to an array tag?
Why doesn't the code "int a = 1000, b = 1000; long int c = a * b;" work?