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
What are the benefits of organizational structure?
Are the variables argc and argv are local to main?
Are comments included during the compilation stage and placed in the EXE file as well?
What is s or c?
List some of the static data structures in C?
Why is main function so important?
What is scanf () in c?
Describe dynamic data structure in c programming language?
Explain c preprocessor?
What is pragma c?
What do you mean by a local block?
What is atoi and atof in c?
How is actual parameter different from the formal parameter?
In C language, a variable name cannot contain?
Where register variables are stored in c?