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
Explain what are the different data types in c?
What is %lu in c?
Why do we use namespace feature?
What is the purpose of macro in C language?
Distinguish between actual and formal arguments.
What is void pointers in c?
Can you write the algorithm for Queue?
Why do we use & in c?
What do the functions atoi(), itoa() and gcvt() do?
How do you use a pointer to a function?
define string ?
Is null always equal to 0(zero)?
What is the explanation for prototype function in c?
What should malloc(0) do?
What is ponter?