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

How can I remove the leading spaces from a string?

1137


what are the 10 different models of writing an addition program in C language?

1878


What are all different types of pointers in c?

1000


Explain the concept and use of type void.

1097


Is c is a middle level language?

1044


How can I get the current date or time of day in a c program?

1205


Why use int main instead of void main?

1103


What is string concatenation in c?

1076


What does 2n 4c mean?

1216


What is the size of a union variable?

1037


How can I find out the size of a file, prior to reading it in?

1156


how many errors in c explain deply

2074


What are derived data types in c?

1057


What are local static variables?

1132


write a c program in such a way that if we enter the today date the output should be next day's date.

2176