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 are the loops in c?

955


Explain how can I write functions that take a variable number of arguments?

1047


When should volatile modifier be used?

969


any "C" function by default returns an a) int value b) float value c) char value d) a & b

1052


What is #define used for in c?

1027


What is define directive?

1096


What does c mean before a date?

1129


An integer that indentifies the position of a data item in a sequence of data items a) value b) number c) index d) all of the above

1175


What does c mean?

988


What is a nested formula?

1078


What are the different types of errors?

1088


When should you use a type cast?

1068


Tell me the use of bit field in c language?

1033


A SIMPLE PROGRAM OF GRAPHICS AND THEIR OUTPUT I WANT SEE WAHAT OUTOUT OF GRAPHICS PROGRAM

2096


we need to calculating INCOME TAX for the person. The INCOME TAX is as follows:- First $10000/- of income : 4% tax Next $10000/- of income : 8% tax Next $10000/- of income : 11.5% tax above $10, 00,00/- : 15% tax What is the Solution of this Question ?

1223