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
What is pass by reference in functions?
What is optimization in c?
How can I read/write structures from/to data files?
How will you print TATA alone from TATA POWER using string copy and concate commands in C?
What is substring in c?
What is the scope of global variable in c?
How to implement a packet in C
When is the “void” keyword used in a function?
Why can’t we compare structures?
"C" language developed by "Dennis Ritchie" at AT & T. his remarks are a) too general, too abstract b) could deal with only specific problems c) lost generality of BCPL and B restored d) no remarks
What is a string?
What is the use of #define preprocessor in c?
What is union and structure?
What is ambagious result in C? explain with an example.
What is the difference between arrays and pointers?