write a program in C to swap two variables
Answer Posted / senthil mca sns
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
clrscr();
printf("Enter the a value:");
scanf("%d",&a);
printf("Enter the b value:");
scanf("%d",&b);
b=a+b-(a=b);
printf("After Swapping a=%d,b=%d",a,b);
getch();
}
Is This Answer Correct ? | 3 Yes | 2 No |
Post New Answer View All Answers
For what purpose null pointer used?
What tq means in chat?
Why is c still so popular?
write a c program thal will find all sequences of length N that produce the sum is Zero, print all possible solutions?
How can I prevent another program from modifying part of a file that I am modifying?
What is a structure and why it is used?
Explain how do you list files in a directory?
What is c method?
What is the difference between int main and void main?
What is function definition in c?
What are the features of c languages?
What is the purpose of main( ) in c language?
Can main () be called recursively?
Explain how can type-insensitive macros be created?
Explain the advantages and disadvantages of macros.