Header Ads

banner image

Social

Program Menghitung Rata-Rata

Rata-Rata Nilai

#include<conio.h>
#include<iostream>
#include<stdio.h>

using namespace std;
int main()
{
char awal,ulang,nama[21];
float nilai1, nilai2, nilai3,nilai4, rata, absen;
int menu;
cout<<"  Program by :     Eka Wahyu F.S";
cout<<"\n C++ Menghitung Rata-Rata Nilai"<<endl;

awal:

cout<<" PROGRAM HITUNG NILAI RATA-RATA"<<endl;
cout<<endl;
cout<<"___________________________________________________________"<<endl;
cout<<endl;
cout<<" Nama Siswa  :" ; cin>>nama ;
cout<<"  absen   : "; cin>>absen;
cout<<" Nilai  I   : "; cin>>nilai1;
cout<<" Nilai  II  : "; cin>>nilai2;
cout<<" Nilai  III : "; cin>>nilai3;
cout<<" Nilai  IV  : "; cin>>nilai4;

rata=(nilai1+nilai2+nilai3+nilai4)/4;

if (rata>=78)
 {
     cout<<"Selamat Anda Lulus"<<endl;
 }

else if (rata<=78)
 {
     cout<<"Maaf Anda Tidak Lulus"<<endl;
 }

    cout<<endl;
    cout<<" NAMA "<<nama<<" Dengan absen "<<absen;
       cout<<"\n Jumlah Rata-Rata : "<<rata<<endl;




  cout<<"Apakah ingin menghitung lagi? [Y/T] ?: ";cin>>ulang;
    if (ulang=='Y'||ulang=='y')
     goto awal;
    else
     getch();
     return 0;


}
di atas program rata-rata nilai semoga bermanfaat ya gan :-)
Program Menghitung Rata-Rata Program Menghitung Rata-Rata Reviewed by ekawahyu on 03:54 Rating: 5

No comments:

Home Ads

Powered by Blogger.