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

Answer Posted / saurav raj

#include<stdio.h>
#include<conio.h>

void main()
int a,b;
clrscr();
printf("Enter Two number a & b:- ");
scanf("%d%d",&a,&b);
a=a+b;
b=a-b;
a=a-b;
printf("\nA=%d \t B=%d",a,b);
getch();

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain how many levels deep can include files be nested?

620


Explain what does a function declared as pascal do differently?

630


how do you write a function that takes a variable number of arguments? What is the prototype of printf () function?

1484


Write a C program in Fibonacci series.

622


What are conditional operators in C?

617






how do you execute a c program in unix.

633


What does a derived class inherit from a base class a) Only the Public members of the base class b) Only the Protected members of the base class c) Both the Public and the Protected members of the base class d) .c file

654


What is string function in c?

529


An application package has been provided to you without any documents for the following application. The application needs to be tested. How will you proceed?

661


In a header file whether functions are declared or defined?

625


what is the difference between class and unio?

1854


Can you please explain the difference between strcpy() and memcpy() function?

593


How many keywords are there in c?

583


What does != Mean in c?

579


What standard functions are available to manipulate strings?

553