Create a program that will ask for an input number and provide a menu that displays the following: (a) Square root (b) Cosine (c) Tangent (d) Absolute (e) Cosine. Ask the user what operation should be applied on the input number. The program must display the required output.
2. Write a program that will swap two input numbers. Use 2 variables only
3. Convert the given program using one kind of loop only.
#include <iostream.h>
#include <conio.h>
void main ()
{
int counter, first, last, s;
first = 1; last = 10;
for (counter = first; counter <= last; counter++)
{
cout << "nX = " << counter;
s = counter * counter;
cout << " X*X = " << s;
}
counter = first;
while (counter <= last)
{
cout << "nX = " << counter;
s = counter * counter;
cout << " X*X = " << s;
counter++;
}
counter = first;
do
{
cout << "nX = " << counter;
s = counter * counter;
cout << " X*X = " << s;
counter++;
} while (counter <= last);
getch();
}