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
How do I use void main?
What Is The Difference Between Null And Void Pointer?
Is there a way to switch on strings?
Explain what does the characters 'r' and 'w' mean when writing programs that will make use of files?
Is there a built-in function in C that can be used for sorting data?
What is the argument of a function in c?
What are the types of arrays in c?
Explain what would happen to x in this expression: x += 15; (assuming the value of x is 5)
What is ponter?
What is the use of bitwise operator?
When was c language developed?
Differentiate between a for loop and a while loop? What are it uses?
What is huge pointer in c?
Can you apply link and association interchangeably?
Why is structure important for a child?