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 in C to swap two variables

Answer Posted / srinivas

#include <stdio.h>

int main(void)
{
int a = 2, b = 5;

a = a + b;
b = a - b;
a = a - b;
printf("%d\t%d\n", a, b);
return 0;
}

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

write a C program: To search a file any word which starts with ?a?. If the word following this ?a? starts with a vowel.Then replace this ?a? with ?a? with ?an?. redirect with the output onto an output file.The source file and destination file are specified by the user int the command line.

2865


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

1089


Write a program of prime number using recursion.

1097


What is the value of a[3] if integer a[] = {5,4,3,2,1}?

1100


What is c definition?

1283


Write a program to reverse a given number in c?

1043


Can you think of a logic behind the game minesweeper.

2470


What is identifiers in c with examples?

1185


Write a program to swap two numbers without using third variable?

1316


What are the 5 types of inheritance in c ++?

1028


Draw a flowchart to produce a printed list of all the students over the age of 20 in a class .The input records contains the name and age of students. Assume a sentinel value of 99 for the age field of the trailer record

5216


What will the preprocessor do for a program?

1081


Can 'this' pointer by used in the constructor?

1099


Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]

1091


Can you write the function prototype, definition and mention the other requirements.

1146