#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 general form of a C program?
How do you use a pointer to a function?
What are the 5 types of organizational structures?
What is a static function in c?
Explain do array subscripts always start with zero?
When do you not use the keyword 'return' when defining a function a) Always b) Never c) When the function returns void d) dfd
Is c procedural or functional?
Is c object oriented?
Write a C program that will accept a hexadecimal number as input and then display a menu that will permit any of the following operations to be carried out: Display the hexadecimal equivalent of the one's complement. (b) Carry out a masking operation and then display the hexadecimal equivalent of the result. (c) Carry out a bit shifting operation and then display the hexadecimal equivalent of the result. (d) Exit. If the masking operation is selected, prompt the user lor the type of operation (bitwise and, bitwise exclusive or, or bitwise or) and then a (hexadecimal) value for the mask. If the bit shifting operation is selected. prompt the user for the type of shift (left or right), and then the number of bits. Test the program with several different (hexadecimal) input values of your own choice.
How is a null pointer different from a dangling pointer?
Why C language is a procedural language?
What is indirection in c?
What is wild pointer in c with example?
What is the difference between null pointer and wild pointer?
all c language question