tugas 3


.

#include <iostream.h>
#include <conio.h>
#include <stdio.h>
main()
{
char nama[50];
int nilai1,nilai2,nilai3,ratarata;
cout<<"\t\tPROGRAM HITUNG NILAI RATA-RATA"<<endl;
cout<<"(^o^)/---------------------------------------------------------(^o^)/"<<endl;
cout<<endl;
cout<<"Nama                = ";gets(nama);
cout<<"nilai pertandingan I        = " ;cin>>nilai1;
cout<<"nilai pertandingan II        = " ;cin>>nilai2;
cout<<"nilai pertandingan III        = " ;cin>>nilai3;

ratarata= (nilai1+nilai2+nilai3)/3;

                  cout<<endl;
                  cout<<"siswa yang bernama "<<nama;
                  cout<<endl;
                  cout<<"memperoleh nilai rata-rata " <<ratarata;
                  cout<<endl;
                  cout<<"dan menjadi juara ke-";
                  if(ratarata>80)
                  {
                  cout<<"I";
                  }
                  else
                  if(ratarata>75)
                  {
                  cout<<"II";
                  }
                  else
                  if(ratarata>65)
                  {
                  cout<<"III";
                  }
                  else
                  cout<<"TIDAK JUARA";
                  cout<<" dari hasil perlombaan yang diikutinya"<<endl;
                  getch();
                  }





ada di sini cuy

Your Reply