write a program in C to swap two variables
Answer Posted / senthil mca sns
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
clrscr();
printf("Enter the a value:");
scanf("%d",&a);
printf("Enter the b value:");
scanf("%d",&b);
b=a+b-(a=b);
printf("After Swapping a=%d,b=%d",a,b);
getch();
}
Is This Answer Correct ? | 3 Yes | 2 No |
Post New Answer View All Answers
What does stand for?
Is c is a middle level language?
Why is it important to memset a variable, immediately after allocating memory to it ?
What is %s and %d in c?
Explain a pre-processor and its advantages.
Do you know pointer in c?
What is console in c language?
How can I find the modification date and time of a file?
What is a void pointer in c?
Tell me with an example the self-referential structure?
given post order,in order construct the corresponding binary tree
What is a string?
Explain what will the preprocessor do for a program?
What are c header files?
What is use of null pointer in c?