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
Program to find the sum of digits of a given number until the sum becomes a single digit. (e.g. 12345=>1+2+3+4+5=15=>1+5=6)
Explain what will be the outcome of the following conditional statement if the value of variable s is 10?
What are the usage of pointer in c?
How can I sort a linked list?
How can I manipulate individual bits?
How can I copy just a portion of a string?
what do you mean by inline function in C?
The % symbol has a special use in a printf statement. How would you place this character as part of the output on the screen?
Can an array be an Ivalue?
What are 3 types of structures?
What is the best way to store flag values in a program?
What is difference between class and structure?
Is c high or low level?
What are the 32 keywords in c?
HOW TO SOLVE A NUMERICAL OF LRU IN OS ??????