write a program in C to swap two variables
Answer Posted / muzammil
#include <stdio.h>
#include <conio.h>
main()
{
int a,b;
printf("Enter the values: ");
scanf("%d%d",&a,&b);
printf("The values before swapping: %d %d",a,b);
a=a-(b=(-b+(a=a+b)));
printf("The values after swapping are: %d %d",a,b);
getch();
}
| Is This Answer Correct ? | 14 Yes | 3 No |
Post New Answer View All Answers
What is switch in c?
Tell me the use of bit field in c language?
Differentiate between the = symbol and == symbol?
What is a 'null pointer assignment' error?
can any one provide me the notes of data structure for ignou cs-62 paper
What is scope rule of function in c?
What is n in c?
write a c program to do the following: a) To find the area of a triangle. b) To convert the temperature from Fahrenheit to Celsius. c) To convert the time in hours : minutes : seconds to seconds.
please can any one suggest me best useful video tutorials on c i am science graduate.please help me.u can email me to sas29@in.com
Write a program to check palindrome number in c programming?
any C program contains only one function, it must be a) void () b) main () c) message () d) abc ()
What is the correct declaration of main?
What does c mean in standard form?
which is conditional construct a) if statement b) switch statement c) while/for d) goto
What is the size of enum in bytes?