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 numbers without using temp variable.

Answer Posted / sneha chorghade

#include<stdio.h>
void main()
{
int a=2,b=3;
printf("before swap the value is:::");
printf("a=%d\tb=%d",a,b);
a=a+b;
b=a-b;
a=a-b;
printf("after swap the value is:::");
printf("a=%d\tb=%d",a,b);
}

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

pgm to find number of words starting with capital letters in a file(additional memory usage not allowed)(if a word starting with capital also next letter in word is capital cann't be counted twice)

2328


The file stdio.h, what does it contain?

1154


What is sizeof c?

1070


Explain what is the benefit of using #define to declare a constant?

1175


Using functions, write a program that multiplies two arrays. Use the following functions: - Function ReadArray - Function MultiplyArrays - Function DisplayArrays

2346


Explain the process of converting a Tree into a Binary Tree.

2661


What do you know about the use of bit field?

1043


What is #line in c?

1011


Explain what is the general form of a c program?

1086


Is there any possibility to create customized header file with c programming language?

1062


How can you tell whether a program was compiled using c versus c++?

1099


What is sizeof in c?

1001


Explain the difference between malloc() and calloc() function?

1040


What is a dynamic array in c?

1152


Explain why can’t constant values be used to define an array’s initial size?

1350