1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
serg [7]
2 years ago
7

write the program or pseudocode algorithm that computes the product and average of three integers and display the results​

Computers and Technology
1 answer:
sweet-ann [11.9K]2 years ago
7 0

<u>Answer:</u>

<u><em>Algorithm: </em></u>

<em>Step 1: </em><em>Begin </em>

<em>Step 2: </em><em>Obtain the inputs – all the three integers </em>

<em>Step 3: </em><em>Calculate product using the formula “a*b*c” </em>

<em>Step 4: </em><em>Calculate sum and then with the help of sum calculate the average </em>

<em>Step 5: </em><em>Print the value of product and average </em>

<em>Step 6: </em><em>End </em>

<u>Explanation:</u>

<u><em>Program: </em></u>

<em>#include<stdio.h> </em>

<em>int main () { </em>

<em>    int a, b, c; </em>

<em>    printf(""Enter three numbers: ""); </em>

<em>    scanf(""%d %d %d"", &a, &b, &c); </em>

<em>    int sum = a + b + c; </em>

<em>    int product = a * b * c; </em>

<em>    float avg = sum / 3.0; </em>

<em>    printf(“Product = %d”, product”);  </em>

<em>    printf(""Sum = %d, Average = %f"", sum, avg); </em>

<em>    return 0; </em>

<em>} </em>

You might be interested in
Which leader of the Jamestown colony am I?
faltersainse [42]
I am not completely sure, but I believe that the leader of the Jamestown colony described in this paragraph is John Rolfe.
7 0
3 years ago
Read 2 more answers
c++ 2.30 LAB: Phone number breakdown Given a long long integer representing a 10-digit phone number, output the area code, prefi
Nady [450]

Answer:

#include <iostream>

using namespace std;

int main()

{

   //declare variable to store phone numbers,its area code, prefix and line number.

   long phone_number;

   int area_code, prefix,line_number;

   cout<<"Enter 10-digit phone number:"<<endl;

   //input 10-digit phone number

   cin>>phone_number;

   //logic to find area_code, prefix, and line_number.

   area_code = phone_number/10000000;

   prefix = (phone_number/10000)%1000;

   line_number = phone_number%10000;

   //output phone number in asked format.

   cout<<area_code<<"-"<<prefix<<"-"<<line_number<<endl;

   return 0;

}

Output:

Enter 10-digit phone number:

8005551212

800-555-1212

Explanation:

In the above program 10 digit phone number entered by user will be stored in the variable phone_number.

Then using this phone_number variable area_code, prefix, and line number are calculated using the following logic:

area_code = phone_number/10000000;

prefix = (phone_number/10000)%1000;

line_number = phone_number%10000;

Finally these area_code, prefix, and line_number are displayed with hyphen in between using cout statement.

5 0
3 years ago
A_______VPN connection is a private network that uses a public
goldfiish [28.3K]

Answer:

letter c. point to site po sagot diyan

3 0
2 years ago
What ideas should I write about for information writing
Lady bird [3.3K]
Well first of all who is your favorite celebrity?
Then find some research and look up interesting facts you did not know about.
5 0
3 years ago
Read 2 more answers
Read the following scenario, and then answer the question below.
shtirl [24]
Establish what skills are required to reach his goal
8 0
2 years ago
Read 2 more answers
Other questions:
  • The _______ valve protects the air pump from reverse-exhaust pressure.
    11·1 answer
  • The major difference between a calculator and a computer, when performing calculations, is that a
    10·1 answer
  • Which best describes inserting a table using the Table Gallery
    10·2 answers
  • Indenting the start and finish of segments
    8·2 answers
  • You would like to conduct a survey and ask your web page visitors to indicate the computer operating systems that they use. Each
    5·1 answer
  • In this problem, we explore some of the properties of the CRC. For the generator G (=1001) given in Section 5.2.3, answer the fo
    14·1 answer
  • What outline feature can the Navigation pane browse the document by?
    14·2 answers
  • The Internet Engineering Task Force (IETF) defines the protocols and standards for how the Internet works. The members of the IE
    12·1 answer
  • Which of the following is true about radio waves? They have short wavelengths. They have high energies. They reveal hot gases. T
    10·2 answers
  • Computer can do work very___​
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!