Program Hitung Rata-rata Pertandingan menggunakan if
#include<conio.h>
#include<stdio.h>
#include<iostream.h>
main()
{
char nama[20];
float p1,p2,p3,r=0;
cout<<"nama siswa : ";cin>>nama;
cout<<"nilai pertandingan1 : ";cin>>p1;
cout<<"nilai pertandingan2 : ";cin>>p2;
cout<<"nilai pertandingan3 : ";cin>>p3;
r=(p1+p2+p3)/3;
clrscr();
cout<<"siswa yang bernama : "<<nama<<endl;
cout<<"memperoleh nilai rata-rata : "<<r<<endl;
cout<<"dari hasil perlombaan yang di ikutinya "<<endl;
getche();
}
Selamat Mencoba..
Monday, January 10, 2011
Program Hitung Rata-rata Pertandingan
Label:
Borland c++
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment