Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

pliz.......... help me guys,girls?

aku lagi bingung bgt soalnya aku lagi bljr pemograman komputer ttg C++

pening gw

udah IQ gue 'jongkok' eh.......... malah dikasih tugas beginian lagi

cape deh...........

ada yg tau gak gimana membuat project(tugas) ttg c++ yg bgs trus C++ itu sebenernya apaan sih.........???????????(KALIMATNYA HRS YG SESEDERHANA MUNGKIN BIAR GW GAK TMBH RIBET) tolongin dong

2 Answers

Rating
  • 1 decade ago
    Favorite Answer

    nie aku kasih contoh cara menghitung nilai rata-rata menggunakan program c++..

    ini contoh yang sederhana banget..

    kalo kamu pengen tau lebih banyak tentang c++, harus banyak tanya, baca dan praktek juga,,jadi mesti fokus juga...

    #include<iostream.h>

    main()

    {

    float x[100];

    float rata;

    int n;

    cout<<"menghitung nilai rata_rata\n\n";

    cout<<"banyaknya data yang di input=";

    cin>>n;

    for(int i=0;i<n;i++)

    {

    cout<<"data ke-"<<(i+1)<<"=";

    cin>> x[i];

    }

    float jumlah =0;

    for(i=0;i<n;i++)

    {

    jumlah = jumlah + x[i];

    }

    // cout << jumlah<< endl;

    rata=jumlah/n;

    cout << rata<< endl;

    }

    moga membantu, mudah2an dapat di mengerti..

    good luck yach..

  • Laur@
    Lv 7
    1 decade ago
Still have questions? Get your answers by asking now.