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

List some applications of c programming language?

916


what is the role you expect in software industry?

2107


Explain the array representation of a binary tree in C.

1181


Differentiate abs() function from fabs() function.

971


What does %d do in c?

921


Explain is it valid to address one element beyond the end of an array?

1164


How can you allocate arrays or structures bigger than 64K?

1093


What is %lu in c?

1198


How will you delete a node in DLL?

1244


What is the best way to store flag values in a program?

1022


Explain what would happen to x in this expression: x += 15; (assuming the value of x is 5)

1238


simple program of graphics and their output display

1957


What are different types of pointers?

1026


What is #pragma statements?

1065


Can static variables be declared in a header file?

1027