WRITE A SIMPLE C++ PROGRAM TO SWAP TWO NOS WITHOUT USING TEMP

Answers were Sorted based on User's Feedback



WRITE A SIMPLE C++ PROGRAM TO SWAP TWO NOS WITHOUT USING TEMP..

Answer / vinodhini r

main()
{
int a,b;
scanf("%d %d",&a,&b);
a=a+b;
b=a-b;
a=a-b;
printf("%d %d",a,b);
}

Is This Answer Correct ?    26 Yes 2 No

WRITE A SIMPLE C++ PROGRAM TO SWAP TWO NOS WITHOUT USING TEMP..

Answer / illa

sorry that is correct

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More OOPS Interview Questions

Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the maximum number of concurrent threads that the InnoDB plug-in can create.

1 Answers  


What is polymorphism in oops?

0 Answers  


What is encapsulation oop?

0 Answers  


What are the 3 pillars of oop?

0 Answers  


write a code for this:trailer recordId contains a value other than 99, then the file must error with the reason ‘Invalid RECORD_ID’(User Defined Exception).

0 Answers  






why function overloading is not called as pure polymorphism?

2 Answers  


which are the 4 members functions in c++ objects that can either be declared explicitly by programmer or implementation if nt available.

4 Answers  


What is polymorphism programming?

0 Answers  


What is byval and byref? What are differences between them?

0 Answers   HCL, Wipro,


What is pointer in oop?

0 Answers  


Can a destructor be called directly?

0 Answers  


Question: 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.

0 Answers  


Categories