WAP in c++ to Initialize the two variable and interchange there values without using third variable.
Answers
Answered by
2
Answer:
I am not going to write the whole program as it is not a good practice. But I'll write down the key steps involved for solving the problem.
Explanation:
int a = 5;
int b = 10;
a = a + b; // a = 5 + 10 = 15
b = a - b; // b = 15 - 10 = 5
a = a - b; // a = 15 - 5 = 10
cout<<"FIRST:"<<a<<"\t SECOND:"<<b;
Answered by
0
Explanation:
The formula to calculate the simple interest is: simple_interest = (P * T * R) / 100 where P is principal amount, T is time & R is rate of interest.
Similar questions