write a program to swap Two numbers without using temp variable.
Answer Posted / gaurav sharma
#include<conio.h>
#include<stdio.h>
void main()
{
clrscr();
int a,b;
printf("enter the value of a : ");
scanf("%d",&a);
printf("enter the value of b : ");
scanf("%d",&b);
printf("Before swapping a is %d and b is %d",a,b);
a=a+b;
b=a-b;
a=a-b;
printf("\nAfter swapping of a and b:\na=%d\nb=%d",a,b);
getch();
}
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Q.1 write aprogram to stack using linklist o insert 40 items? Q.2 write a program to implement circular queue with help of linklist?
How do you redirect a standard stream?
The number of bytes of storage occupied by short, int and long are a) 2, 2 and 4 b) 2, 4 and 4 c) 4, 4 and 4 d) none
Combinations of fibanocci prime series
how do you programme Carrier Sense Multiple Access
Explain what is the difference between null and nul?
Explain how do I determine whether a character is numeric, alphabetic, and so on?
Can you write the algorithm for Queue?
What does the error message "DGROUP exceeds 64K" mean?
How many types of operator or there in c?
What are the types of c language?
What does %c mean in c?
Why does everyone say not to use gets?
What is multidimensional arrays
7-Given an index k, return the kth row of the Pascal's triangle. For example, when k = 3, the row is [1,3,3,1]. For reference look at the following standard pascal’s triangle.