write a program to swap Two numbers without using temp variable.
Answer Posted / tchoephel
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
printf("enter two nos A and B\n");
scanf("%d%d",a,b);
printf("before swaping A=%d\n B=%d\n",a,b);
a=a+b:
b=a-b;
a=a-b;
prinf("after swaping A=%d\n B=%d\n",a,b);
getch();
}
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is a pointer value and address in c?
What is the use of c language in real life?
How is a null pointer different from a dangling pointer?
all c language question
What is the meaning of && in c?
What is indirection in c?
What is function definition in c?
Is sizeof a keyword in c?
Given two strings S1 and S2. Delete from S2 all those characters which occur in S1 also and finally create a clean S2 with the relevant characters deleted.
What does 4d mean in c?
How do you define CONSTANT in C?
what is a constant pointer in C
write a c program to print the next of a particular no without using the arithmetic operator or looping statements?
How are Structure passing and returning implemented by the complier?
What is p in text message?