write a program to swap Two numbers without using temp variable.

Answer Posted / guest

# include "stdio.h"
main()
{
int a,b;
printf("enter two numbers for swaping");
scanf("%d%d",&a,&b);
a=a+b;
b=a-b;
a=a-b;
printf("a is %d",a);
printf("b is %d",b);
} output:- takea,b value is 2,3 and give answers is3,2

Is This Answer Correct ?    243 Yes 58 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I read/write structures from/to data files?

538


How can I access an I o board directly?

609


What is variable declaration and definition in c?

488


What should malloc(0) do?

602


Is using exit() the same as using return?

666






main() { printf("hello"); fork(); }

681


What are high level languages like C and FORTRAN also known as?

665


What is conio h in c?

609


What is the difference between ā€˜gā€™ and ā€œgā€ in C?

2486


Explain what is #line used for?

597


How can I write a function that takes a format string and a variable number of arguments?

593


What is c preprocessor mean?

769


how to find binary of number?

3403


Who invented b language?

899


What is c language & why it is used?

568