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


Please Help Members By Posting Answers For Below Questions

what do the 'c' and 'v' in argc and argv stand for?

647


I have seen function declarations that look like this

603


What type is sizeof?

587


What are the types of data types and explain?

673


Why is #define used?

790






What is data type long in c?

626


What is the difference between mpi and openmp?

736


How many types of sorting are there in c?

614


You have given 2 array. You need to find whether they will create the same BST or not. For example: Array1:10 5 20 15 30 Array2:10 20 15 30 5 Result: True Array1:10 5 20 15 30 Array2:10 15 20 30 5 Result: False One Approach is Pretty Clear by creating BST O(nlogn) then checking two tree for identical O(N) overall O(nlogn) ..we need there exist O(N) Time & O(1) Space also without extra space .Algorithm ?? DevoCoder guest Posted 3 months ago # #define true 1 #define false 0 int check(int a1[],int a2[],int n1,int n2) { int i; //n1 size of array a1[] and n2 size of a2[] if(n1!=n2) return false; //n1 and n2 must be same for(i=0;ia1[i+1]) && (a2[i]>a2[i+1]) ) ) return false; } return true;//assumed that each array doesn't contain duplicate elements in themshelves }

2714


What are the different types of control structures in programming?

660


What is the code in while loop that returns the output of given code?

1320


What are identifiers and keywords in c?

573


What is the difference between volatile and const volatile?

565


What is a lvalue

664


What is p in text message?

540