What's new

Closed Need help about c++ language

Status
Not open for further replies.

Kingrhejj

Addict
Joined
Oct 14, 2017
Posts
191
Reaction
34
Points
105
Create a program written in C++ language that will calculate and print the sum and average of five numbers. The five numbers are: 12.7, 33, 4, 5.9, 6.09. Use any identifiers to represent the five numbers. The result must be in floating number format.

(late na kasi ako na-enroll kaya di ko pa alam pano to
patulong nman po)

salamat sa papansin
 
Search ka po sa: Sololearn .com/ w3schools .com
ICT student here more on solo learning ako share ko yang websites na yan hehe jan ako nagaaral ng ibang language
 
Code:
#include <iostream>
using namespace std;
int main()
{
    double a = 12.7;
    double b = 33;
    double c = 4;
    double d = 5.9;
    double e = 6.09;
    double sum = a + b + c + d + e;
    double average = sum / 5.0;

    cout<<"sum: "<<sum;
    cout<<endl;
    cout<<"average: "<<average;

    return 0;
}
 
Status
Not open for further replies.

Similar threads

Back
Top