You are on page 1of 4

/******************************************************************************

Welcome to GDB Online.


GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debug online from anywhere in world.

*******************************************************************************/
#include <stdio.h>
#include <iostream>

using namespace std;

int main()
{
int x;

cout << "Menentukan Bilangan Ganjil atau bukan ganjil\n";


cout << "Masukan Nilai x:";
cin >> x;

if (x%2==1) {
cout << x << " adalah bilangan Ganjil\n";
}
else{
cout << x << " adalah Bukan bilangan Ganjil\n";
}

return 0;
}
int main()
{
int nilai;
cout << "Masukan nilai : ";
cin >> nilai;
if(nilai>=75){
cout << "Kamu lulus\n";
}else{
cout << "Kamu belum lulus\n";
}
return 0;
}
#include <stdio.h>
#include <iostream>

using namespace std;

int main()
{
int tugas, uts, uas, nilai_akhir;

cout << "PROGRAM PENENTU NILAI AKHIR\n\n";

cout << "MASUKKAN NILAI TUGAS:";


cin >> tugas;
cout << "MASUKKAN NILAI UTS:";
cin >> uts;
cout << "MASUKKAN NILAI UAS:";
cin >> uas;

//membuat rumus Nilai Akhir


nilai_akhir=(0.2*tugas+0.3*uts+0.5*uas);
cout << "NILAI AKHIR = " << nilai_akhir << "\n";

// A>=80, B>=68, C>=56, D>=45, E>=0


if(nilai_akhir>=80){
cout << "INDEKS: A";
}else if (nilai_akhir>=68){
cout << "INDEKS: B";
}else if (akhir>=56){
cout << "INDEKS: C";
}else {
cout << "INDEKS: D";
}

return 0;
}

You might also like