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 are shell structures used for?

1030


Explain low-order bytes.

1016


Write a program of prime number using recursion.

1067


Is null always defined as 0(zero)?

1082


exit () is used to a) exit () terminates the execution of the program itself b) exit () terminates the execution of the loop c) exit () terminates the execution of the block d) none of the above

1100


code for quick sort?

2008


What type of function is main ()?

1028


Where are some collections of useful code fragments and examples?

1146


Why main is not a keyword in c?

1235


What does int main () mean?

1005


Explain how does flowchart help in writing a program?

1101


How do you convert a decimal number to its hexa-decimal equivalent.Give a C code to do the same

1086


Explain can you assign a different address to an array tag?

1035


#include show(int t,va_list ptr1) { int a,x,i; a=va_arg(ptr1,int) printf(" %d",a) } display(char) { int x; listptr; va_star(otr,s); n=va_arg(ptr,int); show(x,ptr); } main() { display("hello",4,12,13,14,44); }

1268


void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }

1709