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 / dhanalakshmi

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

Is This Answer Correct ?    7 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write the test cases for checking a variable having value in range -10.0 to +10.0?

2316


Why do we need arrays in c?

1152


What language is c written?

1041


number of times a digit is present in a number

2037


Define circular linked list.

1026


Explain goto?

1150


Explain the difference between #include "..." And #include <...> In c?

1024


please explain clearly about execution of c program in detail,in which stage are the printf sacnf getting into exeecutable code

2174


Explain heap and queue.

1078


What is union in c?

1115


if p is a string contained in a string?

1841


Explain what are the different data types in c?

1215


What does the function toupper() do?

1120


What is the value of c?

1061


what is the difference between north western polytechnique university and your applied colleges?? please give ur answers for this. :)

2403