Untuk Mencari Nilai Total
#include <iostream>
using namespace std;
int main()
{
int aga,pkn,total;
string ket;
cout<<"Masukan Nilai Agama : ";<<aga;
cout<<"Masukan Nilai Pkn : ";<<pkn;
cout<<"********************************"<<endl;
cout<<"total nilai : "<< total (aga+pkn) endl;
if (total>70)
ket = lulus;
else
cout<<"tidak lulus"<<endl;
return 0;
}
Untuk Mencari Nilai Rata-rata
#include <iostream>
using namespace std;
int main ()
{
float aga,pti,pkn,rata;
cout<<"Masukan Nilai Agama : ";cin>>aga;
cout<<"Masukan Nilai Pti : ";cin>>pti;
cout<<"Masukan Nilai Ppkn : ";cin>>pkn;
rata = aga+pti+pkn/2;
if (rata > 70)
cout<<"lulus";
else
cout<<"E";
return 0;
}
Comments
Post a Comment