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);
}
Answer Posted / 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 |
Post New Answer View All Answers
explain what is an endless loop?
What is a nested loop?
What is the difference between union and structure in c?
What is the difference between pure virtual function and virtual function?
What does the function toupper() do?
What is spaghetti programming?
How can you read a directory in a C program?
What is c programming structure?
a number whose only prime factors are 2,3,5, and 7 is call humble number,,write a program to find and display the nth element in this sequence.. sample input : 2,3,4,11,12,13, and 100.. sample output : the 2nd humble number is 2,the 3rd humble number is 3,the 4th humble number is ,the 11th humble number is 12, the 12th humble number is 14, the 13th humble number is 15, the 100th humble number is 450.
List some of the static data structures in C?
Explain what are its uses in c programming?
What is the usage of the pointer in c?
What is difference between structure and union?
Write a program to swap two numbers without using third variable?
main() { int i = 10; printf(" %d %d %d ", ++i, i++, ++i); }