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 variables a=5 , b= 10 without
using third variable

Answer Posted / samruthi

#include<stdio.h>
void main()
{
int a=5,b=10;
printf("The value of A is:%d",a);
printf("\n The value of B is:%d",b);
b=a;
a=b;
a=b+a;

printf("\n The value of A is:%d",a);
printf("\n The value of B is:%d",b);
getch();
}

Is This Answer Correct ?    10 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a program to reverse a given number in c language?

1161


What is f'n in math?

1135


What does %p mean c?

1115


What is the purpose of main() function?

1302


List out few of the applications that make use of Multilinked Structures?

2257


what do you mean by inline function in C?

1098


How was c created?

1090


What is main () in c language?

1185


What is #line?

1108


What are the c keywords?

1255


Explain modulus operator. What are the restrictions of a modulus operator?

1057


What are data structures in c and how to use them?

1219


What is a program flowchart and how does it help in writing a program?

1188


What is line in c preprocessor?

1099


What are the different types of constants?

1127