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
Which is better pointer or array?
What are the primitive data types in c?
difference between native and cross compilers
What is a pointer on a pointer in c programming language?
Is javascript based on c?
Explain what is a static function?
What is the difference between a free-standing and a hosted environment?
How is actual parameter different from the formal parameter?
How can I pad a string to a known length?
what will be maximum number of comparisons when number of elements are given?
What do you understand by friend-functions? How are they used?
Explain what is the difference between far and near ?
how to write optimum code to divide a 50 digit number with a 25 digit number??
What is main function in c?
What is the code for 3 questions and answer check in VisualBasic.Net?