write a program in C to swap two variables
Answer Posted / muzammil
#include <stdio.h>
#include <conio.h>
main()
{
int a,b;
printf("Enter the values: ");
scanf("%d%d",&a,&b);
printf("The values before swapping: %d %d",a,b);
a=a-(b=(-b+(a=a+b)));
printf("The values after swapping are: %d %d",a,b);
getch();
}
| Is This Answer Correct ? | 14 Yes | 3 No |
Post New Answer View All Answers
Calculate 1*2*3*____*n using recursive function??
Can you think of a logic behind the game minesweeper.
a direct address that identifies a location by means of its displacement from a base address or segment a) absolute address b) relative address c) relative mode d) absolute mode
What is maximum size of array in c?
What is f'n in math?
What does sizeof int return?
What is the use of gets and puts?
Is c still used?
What are the types of type specifiers?
What does the characters “r” and “w” mean when writing programs that will make use of files?
Study the following C program :call_me (myvar)int myvar;{ myvar +- 5; }main(){int myvar;myvar = 3;call_me(myvar);printf("%d ",myvar);What will be printed a) 3 b) 5 c) 8 d) symbol
Explain how can I right-justify a string?
diff between exptected result and requirement?
What is pass by reference in functions?
Differentiate between the = symbol and == symbol?