swap prog

Answer Posted / tayyab

By using recent two variables swap code will be
a=3;
b=5;

a=a+b; a=8
b=a-b; b=3
a=a-b; a=5

Is This Answer Correct ?    6 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

write a program that can LOCATE and INSERT elements in array using c++ programming languages.

3431


How can I Draw an ellipse in 3d space and color it by using graph3d?

2130


write a function that reverse the elements of an array in place.The function must accept only one pointer value and return void.

3952


Write a C/C++ program that connects to a MySQL server and displays the global TIMEZONE.

4573


write a program to perform generic sort in arrays?

2619






Performance Algorithm A performs 10n2 basic operations and algorithm B performs 300 lg n basic operations. For what value of n does algorithm B start to show its better performance?

7334


Question 1: Implement a base class Appointment and derived classes Onetime, Daily, Weekly, and Monthly. An appointment has a description (for example, “see the dentist”) and a date and time. Write a virtual function occurs_on(int year, int month, int day) that checks whether the appointment occurs on that date. For example, for a monthly appointment, you must check whether the day of the month matches. Then fill a vector of Appointment* with a mixture of appointments. Have the user enter a date and print out all appointments that happen on that date. *This Should Be Done IN C++

546


write a program to calculate the amount of investment after a period n years if the principal investors was p and interest is calculated using compound interest,formular=a=p(1+r)^n

2364


3. Program to find the Sum of give series. a. (1)+(1+2)+(1+2+3)+(1+2+3+4)+……………………………….. b. 1/1+1/9+1/25+1/49+……………...

4349


develop a program to calculate and print body mass index for 200 employees

2208


write a program that reads a series of strings and prints only those strings begging with letter "b"

2668


i don't know about working of nested for loop can any one help me

1788


solve the problem in the programming language C++"if a five digit number is input through the keyboard.Write a program to calculate the sum of its digits(hint: use the modulus operator)

2930


Code for Easily Using Hash Table?

2385


output for printf("printf");

1977