English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

.Write an algorithm to input 3 numbers, output the square root of
each number and then the average of all 3 of the numbers. You can call a square
root routine, Math.sqrt to find the square root.
Compute the average of the square roots and the square root of the average.
What is the relationship between the 2? - will the relationship
always be true and why.

2007-02-08 17:43:25 · 3 answers · asked by Anonymous in Computers & Internet Programming & Design

3 answers

That's not an algorithm, that's homework.

2007-02-08 17:51:05 · answer #1 · answered by Anonymous · 1 0

an algorithms are products of code that is universally utilized to many diverse factors in a game, they're a large time saver. In C what you may do is discover an action that is universally utilized to any area of regardless of it rather is you are trying to make. to illustrate: a menu. extremely then retyping the code persistently back, you are able to genuinely reproduction and paste a piece of the code and replace the variables with what it rather is which you extremely choose to do. residing house button+ click= run identify show. start up button+ click= in game menu. The above is ofcourse isn't surely programming yet i'm hoping you the assumption

2016-11-02 23:15:49 · answer #2 · answered by ? 4 · 0 0

#include
#include
using namespace std;

main(){
float n1,n2,n3;
float r1,r2,r3;
float an, ar;
while(true){
system("cls");
cout << endl << endl;

cout << "\nEnter the first number :" ;
cin >> n1;

cout << "\nEnter the second number :" ;
cin >> n2;

cout << "\nEnter the third number :" ;
cin >> n3;

an=(n1+n2+n3)/3.0;


r1=sqrt(n1);
r2=sqrt(n2);
r3=sqrt(n3);

cout << "\n\nsquare root of the first number : " << r1;
cout << "\nsquare root of the second number : " << r2;
cout << "\nsquare root of the third number : " << r3;


ar=(r1+r2+r3)/3.0;

cout << "\n\nthe average of the three square roots : " << ar;
cout << "\nthe average of the three entered numbers : " << an;
cout << "\n\nthe square root of the average of entered numbers: " << sqrt(an);
cout << endl << endl;
system("pause");
}
}

2007-02-08 23:13:46 · answer #3 · answered by iyiogrenci 6 · 1 0

fedest.com, questions and answers