#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 / manish soni tagore collage jai
my dear frd....
here some hapen.
#define swap(a,b) temp=a;a=b;b=temp;----------(1)
is was as function of swap two no;(but it is differnt frm
funtion.)
so
at i>j;
enter swap(i,j);
so jump at eq(n) ---(1) and call swap function'
and
temp=5;
i=10;
j=0;
you see three variable.
but it printf i,j to convert swap.
bcoz it have two arguments.
and print temp=0;
becoz temp have 0;
| Is This Answer Correct ? | 0 Yes | 7 No |
Post New Answer View All Answers
What are types of functions?
Why are some ANSI/ISO Standard library routines showing up as undefined, even though I've got an ANSI compiler?
what do you mean by enumeration constant?
What is typedef example?
How can I handle floating-point exceptions gracefully?
Explain how can I write functions that take a variable number of arguments?
Is calloc better than malloc?
What are the 4 types of functions?
the statement while(i) puts the entire logic in loop. this loop is called a) indefinite loop b) definite loop c) loop syntax wrong d) none of the above
Write a program to swap two numbers without using the third variable?
How can variables be characterized?
What is difference between function overloading and operator overloading?
Is c language still used?
Tell me when is a void pointer used?
What is extern c used for?