Listingnya..
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
main()
{
float suhu[5];
float total=0;
clrscr();
cout<<"Masukan Data Suhu "<<endl<<endl;
for (int i=0;i<5;i++)
{
cout<<"Suhu Ke : "<<(i+1)<<" = ";
cin>>suhu [i];
total+=suhu [i];
}
cout<<endl;
cout<<"Suhu rata-rata "<<total/5<<endl;
getch();
}
Dan Outputnya ..
Tidak ada komentar:
Posting Komentar