flowchart dan program kasus 3.4
#include <iostream>
using namespace std;
int main()
{
string raptor_prompt_variable_zzyz;
int n;
raptor_prompt_variable_zzyz ="masukkan nilai = ";
cout << raptor_prompt_variable_zzyz << endl;
cin >> n;
if (n>=0 && n<=20)
{
cout << "nilai anda = E" << endl; }
else
{
if (n>20 && n<=40)
{
cout << "nilai anda = D" << endl; }
else
{
if (n>40 && n<=60)
{
cout << "nilai anda = C" << endl; }
else
{
if (n>60 && n<=80)
{
cout << "nilai anda = B" << endl; }
else
{
if (n>80 && n<=100)
{
cout << "nilai anda = A" << endl; }
else
{
cout << "inputan anda salah" << endl; }
}
}
}
}
system("pause");
return 0;
Tidak ada komentar:
Posting Komentar