Iklan

Program Menghitung Angka Rata-rata dengan C++


Menghitung Program Rata2

Inilah Program Menghitung Angka Rata-rata dengan C++ (Dev C++)

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

main () {
char nim[9],nama[20];
int nt1,nt2,nt3,nt4,nt5;
float rata;
using namespace std;

cout <<“PROGRAM HITUNG NILAI RATA-RATA \n”;
cout<<“=================================== \n”;
cout<<“Nim Siswa :”;cin>>nim;
cout<<“\nNama Siswa :”;cin>>nama;
cout<<“\nNilai Tugas I :”;cin>>nt1;
cout<<“\nNilai Tugas II :”;cin>>nt2;
cout<<“\nNilai Tugas III:”;cin>>nt3;
cout<<“\nNilai Tugas IV:”;cin>>nt4;
cout<<“\nNilai Tugas V:”;cin>>nt5;
cout<<“=================================== \n”;
rata=(nt1+nt2+nt3+nt4+nt5)/5;
cout<<“\nNim :”<<nim;
cout<<“\n Siswa yang bernama ‘ “<<nama;
cout<<“‘ memperoleh nilai Rata Rata “<<rata;
cout<<“\n dari hasil tugas yang di ikuti \n”;
getch();
}

Iklan

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: