Algoritma5.1

Run Settings
LanguageC++
Language Version
Run Command
#include <iostream> #include <string.h> using namespace std; int main() { puts ("================================================"); puts ("\tProgram Sturktur Percabangan"); puts ("================================================"); int nilai,jk; char gender [20]; cout<<"Masukan Nilai Mahasiswa [0-100]\t "; scanf("%d",&nilai); printf ("\nJika nilai diatas 55 mahasiswa lulus\n"); printf ("Selain itu maka mahasiswa tidak lulus\n"); puts ("================================================"); printf ("Nilai yan anda masukan adalah\t: %4d\n", nilai); //========================================// if (nilai > 55) { printf ("Hasilnya adalah mahasiswa lulus \n"); }else { printf ("Hasilnya adalah mahasiswa tidak lulus \n"); } //========================================// puts ("================================================"); cout <<"Masukan pilihan jenis kelamin."<<endl<<"[1:Pria, 2:Wanita]\t\t: "; scanf ("%d",&jk); cout<<endl; if (jk == 1) { strcpy(gender, "Pria"); } else if (jk == 2) { strcpy(gender, "Wanita"); } else { strcpy(gender, "Not Supported"); } printf ("Gender yang anda pilih adalah\t: %s\n", gender); puts ("================================================"); cout <<"Nama : Muhammad Chairul Ramadhani"<<endl; cout <<"Nim : 1620230015"; return 0; }
Editor Settings
Theme
Key bindings
Full width
Lines