Question: This is C++ using visual studio 1.Write program using for loop to find out maximum number out of 5 numbers given by user. Note: Total
This is C++ using visual studio
1.Write program using for loop to find out maximum number out of 5 numbers given by user. Note: Total 5 iterations and every time 1 number should be given by the user in the loop body and compare for the largest number at the same time. No array allowed. No user given numbers are allowed outside of the loop body.
2.Write a program to print out the Fahrenheit-Celsius conversion table of range from 00 F to 100 F using while loop, using the C = (5/9) (F 32) formula. Here values of C should be calculated based on the values of F, which are incremented from 0 to 10 by the loop. Since you are using loop, in your whole program you are not allowed to write more than one, cout<
Example Output:
0 degree Fahrenheit equal to C degree Celsius
1 degree Fahrenheit equal to C degree Celsius
- - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - -
10 degree Fahrenheit equal to C degree Celsius
3.Write a single program using nested for loops only that prints the following patterns separately one below the other. For each pattern you are not allowed to use more than one set of nested loop (only one outer for loop and only one inner for loop) and one cout<<*;.
Example output:
*
**
***
****
*****
******
*******
********
*********
**********
4.Write a program with one additional method called Largest(x, y, z). This method will return the maximum value out of three values.
Hints:
a. Write a standard main() method
b. From main() pass those values to the method as argument value; Ex: Largest(a, b, c) or Largest(1, 6, 4)
c. The method should return the maximum value
d. The maximum value should be printed out from the main()
5.Write a program with a function of Call by Reference Parameters to swap the values in two variables.
Sample output:
In the main, the two numbers are 5 and 7
In function, after swapping, the two numbers are 7 and 5
Back in the main again, the two numbers are 7 and 5
6.Write a program, which will invoke two functions from the main() with same name but different signature to practice the function overload.
Two methods are: int Same (int a, int b) and int Same (int a, int b, int c)
The first method should cause printing out Divisible if a is divisible by b, otherwise the method should return the remainder. The second method should return the average of a, b and c.
Hint: you might need type casting.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
