🔒 Closed Need help about c++ language

Status
Not open for further replies.

Kingrhejj

Enthusiast
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

About this Thread

  • 6
    Replies
  • 581
    Views
  • 5
    Participants
Last reply from:
Jouru

Trending Topics

Online now

Members online
1,048
Guests online
1,852
Total visitors
2,900

Forum statistics

Threads
2,286,621
Posts
29,039,067
Members
1,217,079
Latest member
eSKILLZ
Back
Top