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
How can I copy just a portion of a string?
What is pointers in c?
a=10;b= 5;c=3;d=3; if(a printf(%d %d %d %d a,b,c,d) else printf("%d %d %d %d a,b,c,d);
a formula,a series of steps,or well defined set of rules for solving a problem a) algorithem b) program c) erdiagram d) compiler
What is string function c?
What are actual arguments?
Explain null pointer.
What is union and structure in c?
Is using exit() the same as using return?
What is c++ used for today?
How can I open a file so that other programs can update it at the same time?
the real constant in c can be expressed in which of the following forms a) fractional form only b) exponential form only c) ascii form only d) both a and b
What is the use of pointers in C?
When is a null pointer used?
Do array subscripts always start with zero?