Very easy is not.
Here it is its syntax ..
#include <iostream.h>
#include <conio.h>
#include <stdio.h>
void main()
{
int bil1,bil2,bil3,bil4,bil5;
int jumlah;
float rata_rata;
cout<<"Masukkan Bilangan 1 : "; cin>>bil1;
cout<<"Masukkan Bilangan 2 : "; cin>>bil2;
cout<<"Masukkan Bilangan 3 : "; cin>>bil3;
cout<<"Masukkan Bilangan 4 : "; cin>>bil4;
cout<<"Masukkan Bilangan 5 : "; cin>>bil5;
//Menghitung Jumlah Bilangan
jumlah = bil1 + bil2 + bil3 + bil4 + bil5;
//Output Jumlah Bilangan
cout<<endl;
cout<<"Jumlah Bilangan = "<<jumlah<<endl;
//Rata-rata Bilangan
rata_rata = jumlah / 5;
cout<<endl;
cout<<"Rata-rata Bilangan = "<<rata_rata<<endl;
}
its so easy thanks for reading
No comments:
Post a Comment