write a program to swap two variables a=5 , b= 10 without
using third variable

Answer Posted / shafi.shaik

main()
{
int a,b;
clrscr();
printf("enter a, b Value");
scanf("%d%d",&a,&b);
printf("\n%d",a);
printf("\n%d",b);
b=b-a;
a=a+b;
b=a-b;
printf("\n%d",a);
printf("\n%d",b);
getch();
}

Is This Answer Correct ?    1 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain about the constants which help in debugging?

855


How many types of operators are there in c?

616


How do you print only part of a string?

615


How can I manipulate strings of multibyte characters?

639


Given below are three different ways to print the character for ASCII code 88. Which is the correct way1) char c = 88; cout << c << " ";2) cout.put(88);3) cout << char(88) << " "; a) 1 b) 2 c) 3 d) constant

668






Explain bitwise shift operators?

632


write a program that reads lines(using getline), converts each line to an integer using atoi, and computes the average of all the numbers read. also compute the standard deviation.

1983


What are the different types of constants?

640


Explain indirection?

648


What is a constant and types of constants in c?

604


When can you use a pointer with a function?

569


What is a memory leak? How to avoid it?

577


What do you understand by friend-functions? How are they used?

647


What are conditional operators in C?

627


hai iam working in sap sd module for one year and working in lumax ind ltd in desp department but my problem is i have done m.b.a in hr/marketing and working sap sd there is any combination it. can you give right solution of my problem. and what can i do?

1663