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
simple program of graphics and their output display
Why doesnt long int work?
Explain how can you avoid including a header more than once?
How are variables declared in c?
How can type-insensitive macros be created?
Write a programme using structure that create a record of students. The user allow to add a record and delete a record and also show the records in ascending order.
What is difference between structure and union in c?
Why do we use pointer to pointer in c?
What is c programing language?
How can I find the modification date of a file?
What is the difference between array and linked list in c?
Hi can anyone tell what is a start up code?
if a is an integer variable, a=5/2; will return a value a) 2.5 b) 3 c) 2 d) 0
What is the ANSI C Standard?
Dont ansi function prototypes render lint obsolete?