DALAM C++
int main(int argc, char *argv[])
{
float a;
float b;
float Lulus;
float Gagal;
float c;
cout<<"Masukkan Jum Mhl: ";
cin >> a;
Lulus=0;
Gagal=0;
for (b=1;b<=a;b++)
{
cout<<"Masukkan Nilai Mhs: ";
cin>>c;
if(c>=50)
{
Lulus=Lulus+1;
}
else
{
Gagal=Gagal+1;
}}
cout<<"Jumlah Mhs yg Lulus:"<<Lulus<<endl;
cout<<"Jumlah Mhs yg Gagal:"<<Gagal<<endl;
system("PAUSE");
0 komentar:
Posting Komentar