Answer:
The program written in C++ is as follows'
#include<iostream>
using namespace std;
int main()
{
string names[3];
cout<<"Please enter three names: "<<endl;
for (int i = 0; i< 3;i++)
{
cin>>names[i];
}
for (int i = 2; i>= 0;i--)
{
cout<<names[i]<<endl;
}
return 0;
}
Explanation:
This line declares an array for 3 elements
string names[3];
This line prompts user for three names
cout<<"Please enter three names: "<<endl;
This following iteration lets user input the three names
for (int i = 0; i< 3;i++) { cin>>names[i]; }
The following iteration prints the three names in reverse order
for (int i = 2; i>= 0;i--) { cout<<names[i]<<endl; }
print("——OR——") Input ("Temperature value in degree Celsius:"), celsius 2 = float) Celsius 2 = (Fahrenheit 2 * 9/5) + 32; print the result.
The user's input is taken. Enter the temperature in celsius by typing it into the input box. Fahrenheit is equivalent to (celsius multiplied by 1.8) + 32 print(str(celsius)+ "A degree in Celsius is equal to a " + str(fahrenheit)+ " degree in Fahrenheit. The change from C to F is therefore 100/180, or 5/9. It is 180/100 or 9/5 from F to C. As a result, the conversion yields °F = °C (9/5) + 32. As a result, the equation for changing from the Celsius to Fahrenheit scale becomes °F = °C (9/5) + 32. To convert from degrees Fahrenheit to degrees Celsius, do the inverse calculation: subtract 30 from the degrees Fahrenheit reading, then multiply the result by two to obtain the degrees Celsius reading.
Learn more about conversion here-
brainly.com/question/13163755
#SPJ4
Answer:
Recursive solutions can be less efficient than their iterative counterparts
Explanation:
Recursion can be defined or described as a method of solving a problem where the solution depends on solutions to smaller instances of the same problem.
It entails using iteration to ensure that smaller parts of a solution are satisfied towards solving thw overall problem.
Ita major disadvantage seems to be that it seem to be less efficient than their iterative counterparts. This is as a result of concentrating on trying to solve a smaller instances.