write a program in C to swap two variables
Answer Posted / r.aruna
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
clrscr();
printf("Enter the a value");
scanf("%d",&a);
printf("Enter the b value");
scanf("%d",&b);
a=a+b;
b=a-b;
a=a-b;
printf("After swapping a,b value",a,b);
getch();
}
| Is This Answer Correct ? | 11 Yes | 3 No |
Post New Answer View All Answers
Are the outer parentheses in return statements really optional?
Which is best book for data structures in c?
What is the scope of an external variable in c?
What header files do I need in order to define the standard library functions I use?
What is bubble sort in c?
What is return in c programming?
string reverse using recursion
Explain c preprocessor?
What is || operator and how does it function in a program?
What is the purpose of sprintf() function?
What is #line in c?
the 'sizeof' operator reported a larger size than the calculated size for a structure type. What could be the reason?
What is malloc calloc and realloc in c?
What does it mean when a pointer is used in an if statement?
Find duplicates in a file containing 6 digit number (like uid) in O (n) time.