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

Why does the call char scanf work?

1209


What is strcmp in c?

1128


How do you redirect a standard stream?

1110


Write a factorial program using C.

1087


Explain heap and queue.

1094


Define C in your own Language.

1086


How can you determine the size of an allocated portion of memory?

1314


Do you know what are bitwise shift operators in c programming?

1105


provide an example of the Group by clause, when would you use this clause

2199


What is derived datatype in c?

1099


What is c programing language?

1091


What is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?

1248


The number of measuring units from an arbitarary starting point in a record,area,or control block to some other point a) recording pointer b) offset c) branching d) none

1255


Explain how does free() know explain how much memory to release?

1080


What is the function of volatile in c language?

1136