Write a program to interchange two variables without using
the third variable?
Answer Posted / neelam
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
clrscr();
printf("Enter two no.s 4 swap");
scanf("%d%d",&a,&b);
a=a+b;;
b=a-b;
a=a-b;
printf("After swapping no.s are =\n");
printf("a=%d b=%d",a,b);
getch();
}
| Is This Answer Correct ? | 0 Yes | 4 No |
Post New Answer View All Answers
What is the size of array float a(10)?
Explain the difference between strcpy() and memcpy() function?
What is integer constants?
Can include files be nested?
What is a macro in c preprocessor?
I was asked to write a program in c which when executed displays how many no.of clients are connected to the server.
why programs in c are running with out #include
Explain the advantages of using macro in c language?
What is sizeof int?
What is the use of bit field?
Why is a semicolon (;) put at the end of every program statement?
How can I pad a string to a known length?
List some basic data types in c?
What is use of bit field?
What are the 5 organizational structures?