write a program to swap Two numbers without using temp variable.
Answer Posted / sree
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
printf("Enter two numbers");
scanf("%d %d",&a &b);
a=a+b;
b=a-b;
a=a-b;
printf("The swapped values are:");
printf("a:%d",a);
printf("b:%d",b);
getch();
}
Is This Answer Correct ? | 73 Yes | 24 No |
Post New Answer View All Answers
What does return 1 means in c?
What is %s and %d in c?
Differentiate between null and void pointers.
Difference between strcpy() and memcpy() function?
What the advantages of using Unions?
What are the ways to a null pointer can use in c programming language?
Why dont c comments nest?
write a program which the o/p should b in such a way that s triangle if I/p is 3,a Square/rectangle if I/P=4,a pentagon if I/P=5 and so on...forget about the I/P which is less than 3
Can the size of an array be declared at runtime?
Define Spanning-Tree Protocol (STP)
What is context in c?
Devise a program that inputs a 3 digit number n and finds out whether the number is prime or not. Find out its factors.
Describe static function with its usage?
What is the difference between printf and scanf )?
What is pointer in c?