Write a program to interchange two variables without using
the third variable?
Answer Posted / genius
#include <stdio.h>
#include <conio.h>
main()
{
int a,b,temp;
clrscr();
printf("enter two numbers:");
scanf("%d,%d",&a,&b);
printf("values of a and b are %d,%d \n",a,b);
temp=a;
a=b;
b=temp;
printf("swapped values of a and b are %d,%d", a,b);
getch();
}
| Is This Answer Correct ? | 4 Yes | 6 No |
Post New Answer View All Answers
How can you avoid including a header more than once?
Mention four important string handling functions in c languages .
Do you know the purpose of 'register' keyword?
Explain what is wrong with this program statement?
PROGRAM TO WRITE CONTENTS OF 1 FILE IN REVERSE TO ANOTHER FILE,PROGRAM TO COPY 1 FILE TO ANOTHER BY SPECIFYING FILE NAMES AS COMMAND LINE
What is modifier & how many types of modifiers available in c?
What happens if header file is included twice?
Why isn't it being handled properly?
Why we not create function inside function.
Can we declare a function inside a function in c?
Are there any problems with performing mathematical operations on different variable types?
Write a program to check prime number in c programming?
What is modeling?
What is the use of typedef in c?
Are there constructors in c?