#include<stdio.h>
#include<conio.h>
# define swap(a,b) temp=a; a=b; b=temp;
void main( )
{
int i, j, temp;
i=5;
j=10;
temp=0;
if( i > j)
swap( i, j );
printf( "%d %d %d", i, j, temp);
}
Answer Posted / abhijeet
my frnd, C is dumb compiler. It doesn't know what actually
we mean.
Here, in this program, we have defined 1 macro. Ok
this macro wil be inserted and expanded into code.
this gives the unpredicted result. U try and find out what i
mean to say.
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
What is the incorrect operator form following list(== , <> , >= , <=) and what is the reason for the answer?
With the help of using classes, write a program to add two numbers.
What is c language & why it is used?
Explain the difference between malloc() and calloc() function?
What is enumerated data type in c?
What do the functions atoi(), itoa() and gcvt() do?
What are types of structure?
When should structures be passed by values or by references?
int i=10; printf("%d %d %d", i, i=20, i);
cavium networks written test pattern ..
Write a function expand(s1,s2) that expands shorthand notations like a-z in the string s1 into the equivalent complete list abc...xyz in s2 . Allow for letters of either case and digits, and be prepared to handle cases like a-b-c and a-z0-9 and -a-z. z-a:zyx......ba -1-6-:-123456- 1-9-1:123456789987654321 a-R-L:a-R...L a-b-c:abbc
What is volatile variable how do you declare it?
List the difference between a While & Do While loops?
What is structure and union in c?
What are pointers?