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
Is main is a keyword in c?
What are the different types of linkage exist in c?
Differentiate between functions getch() and getche().
To print the pattern 1 2 3 4 5 10 17 18 19 6 15 24 25 20 7 14 23 22 21 8 13 12 11 10 9
In c language can we compile a program without main() function?
What is maximum size of array in c?
What are the advantages of external class?
What is %lu in c?
Do pointers need to be initialized?
What is pointer in c?
What are the functions to open and close file in c language?
what are the advanced features of functions a) function declaration and prototypes b) calling functions by value or by reference c) recursion d) all the above
what is the syallabus of computer science students in group- 1?
I need a help with a program: Write a C program that uses data input in determining the whole of points A and a whole of circles B. Find two points in A so that the line which passes through them, cut through the maximum number of circles.
about c language