🔒 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
  • 576
    Views
  • 5
    Participants
Last reply from:
Jouru

Online now

Members online
949
Guests online
888
Total visitors
1,837

Forum statistics

Threads
2,276,248
Posts
28,968,633
Members
1,231,182
Latest member
ewan19292762
Back
Top