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 meaning of typedef struct in c?
What is the argument of a function in c?
What is actual argument?
Do you know pointer in c?
to print the salary of an employee according to follwing calculation: Allowances:HRA-20% of BASIC,DA-45% of BASIC,TA-10%. Deductions:EPF-8% of BASIC,LIC-Rs.200/-Prof.Tax:Rs.200/- create c language program?
What is the difference between ‘g’ and “g” in C?
How do you sort filenames in a directory?
What is #include stdio h?
What happens if you free a pointer twice?
Are negative numbers true in c?
why do some people write if(0 == x) instead of if(x == 0)?
How many levels deep can include files be nested?
Who developed c language and when?
Is c programming hard?
write a c program to find the largest and 2nd largest numbers from the given n numbers without using arrays