write a program in C to swap two variables
Answer Posted / priyamurugan
#include<stdio.h>
#include<conio.h>
main()
{
int a,b;
printf("\n BEFORE SWAPPING THE NOS");
printf("\n enter the a, b values");
scanf("%d %d",&a,&b);
swap(&a,&b);
printf("\n AFTER SWAPPING THE NOS");
printf("\n a=%d",a);
printf("\n b=%d",b);
getch();
}
swap(int *x,int *y)
{
int t;
t=*x;
*x=*y;
*y=t;
return();
}
| Is This Answer Correct ? | 5 Yes | 2 No |
Post New Answer View All Answers
What is the g value paradox?
Explain what are reserved words?
write a c program to calculate sum of digits till it reduces to a single digit using recursion
What are the advantages and disadvantages of c language?
we need to calculating INCOME TAX for the person. The INCOME TAX is as follows:- First $10000/- of income : 4% tax Next $10000/- of income : 8% tax Next $10000/- of income : 11.5% tax above $10, 00,00/- : 15% tax What is the Solution of this Question ?
What is volatile variable in c with example?
Explain built-in function?
What is the difference between a string and an array?
how to write optimum code to divide a 50 digit number with a 25 digit number??
What is sorting in c plus plus?
Here is a good puzzle: how do you write a program which produces its own source code as output?
What is storage class?
What are the features of c language?
how to write a c program to print list of fruits in alpabetical order?
How can I recover the file name given an open stream or file descriptor?