Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

write a program to swap Two numbers without using temp variable.

Answer Posted / romeld

#include<stdio.h>
main()
{
int a,b;
printf("enter the value of a and b\n");
scanf("%d%d",&a,&b);
printf("before swapping\na=%d\nb=%d\n",a,b);
a=a+b;
b=a-b;
a=a-b;
printf("after swapping\na=%d\nb=%d\n",a,b);
getch();
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is #define in c?

990


What is the difference between procedural and functional programming?

1008


What is time null in c?

1004


What are pointers? Why are they used?

1112


How can you find the day of the week given the date?

1146


What is the use of c language in real life?

972


Why void main is used in c?

998


‎How to define structures? · ‎

1031


Can you please compare array with pointer?

1029


List the difference between a While & Do While loops?

1051


#include { printf("Hello"); } how compile time affects when we add additional header file .

1851


Write a program to produce the following output: 1 2 3 4 5 6 7 8 9 10

15727


Is return a keyword in c?

1030


What are identifiers in c?

1144


What is #include stdlib h?

1055