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 in C to swap two variables

Answer Posted / senthil mca sns

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
clrscr();
printf("Enter the a value:");
scanf("%d",&a);
printf("Enter the b value:");
scanf("%d",&b);
b=a+b-(a=b);
printf("After Swapping a=%d,b=%d",a,b);
getch();
}

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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

995


What are the different types of C instructions?

1260


What is masking?

1110


Create a simple code fragment that will swap the values of two variables num1 and num2.

1241


Why we use break in c?

946


How do you determine the length of a string value that was stored in a variable?

1091


What is difference between union and structure in c?

1083


How many levels of pointers can you have?

1140


what are # pragma staments?

2007


What is a stream in c programming?

1094


Which are low level languages?

1053


How can I recover the file name given an open stream or file descriptor?

1044


Tell me when would you use a pointer to a function?

1023


What header files do I need in order to define the standard library functions I use?

1011


what are the program that using a two dimensional array that list the odd numbers and even numbers separately in a given 10 inputs values

1661