Question
1- Write an interactive C++ program which uses a WHILE loop to add 5 intergers and prints the result. 2- Write an interactive C++ program
1- Write an interactive C++ program which uses a WHILE loop to add 5 intergers and prints the result.
2- Write an interactive C++ program that performs the following tasks;
a.Reads 5 intergers and stores them into array A.
b.Finds the sum of the numbers.
c.Finds the average of the numbers.
d.Print the result.
3- Write a C++ program which perform the following tasks:
a.Interactively reads 9 intergers into two dimensional array,A[4][4].
b.Finds the sum of the Right Diagonal elements.
c.Find the sum of the first row.
d.Find sum of the first column.
e.Print the result (sum of the Right Diagonal elements, sum of the first row and sum of the first column)
Note: You should use a class and an object in writing this programs (see the class notes,Topic-9).
4- Consider the following main function:
Int main ()
Int A[5]={ 0 , 0, 0, 0 };
Int sum = 0;
Int Read - Array ( intA [ ] );
Int Find_Sum ( int A [ ] );
Void Print _Results ( int Sum );
Read-Array (A);
Sum=Find_SumLarger (A);
Print_Results (Sum);
Return 0;
a) Write the function int Read _Array (int A[ ]) to read 5 intergers into one dimensional array.
b) Write the function int Find _Sum ( int A [ ] ) to find the sum of all the numbers stored into the array.
c) Write the function void Print_Results (int Sum) to print the results (sum of the numbers)
Note: You run the program and show the result.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started