write a program in C to swap two variables
Answer Posted / anju
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,temp;
scanf("%d%d",&a,&b);
printf("before swapping value of a=%d and b=%d",a,b);
temp=x;
x=y;
y=temp;
printf("after swapping value of a=%d and b=%d",a,b);
getch();
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is the difference between text and binary modes?
What is array of structure in c?
What is the advantage of an array over individual variables?
What is indirection? How many levels of pointers can you have?
What is main function in c?
What is the scope of local variable in c?
What is bss in c?
Write a progarm to find the length of string using switch case?
what do you mean by inline function in C?
What is bin sh c?
What is conio h in c?
What does the characters “r” and “w” mean when writing programs that will make use of files?
How can I pad a string to a known length?
Subtract Two Number Without Using Subtraction Operator
What is difference between union and structure in c?