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 / nagendra kumar

#include<stdio.h>
main(){
int a,b;

printf("Enter A value: ");
scanf("%d",&a);

printf("\nEnter B value: ");
scanf("%d",&b);


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

a=a+b;
b=a-b;
a=a-b;

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

Is This Answer Correct ?    20 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does 1f stand for?

1179


Is null always equal to 0(zero)?

1044


Difference between Shallow copy and Deep copy?

2032


Hai,I have done with my bachelor of commerce and planing to ms,please suggest me how to convince vo for shifting from commerce to computers. Visa on 8 DEC 2014  Npu university

2048


Write a program in "C" to calculate the root of a quadratic equation ax^2+bx+c=0, where the value of a,b & c are known.

2242


What do you mean by keywords in c?

1160


What functions are used in dynamic memory allocation in c?

1097


What is meant by type specifiers?

1143


c program for searching a student details among 10 student details

2093


How can I pad a string to a known length?

1044


What is the purpose of realloc()?

1152


What was noalias and what ever happened to it?

1051


How are portions of a program disabled in demo versions?

1303


What is the difference between the local variable and global variable in c?

974


What is declaration and definition in c?

1108