#include <iostream.h>
#include<conio.h>

void Hasil (int x, int y){
    if (x==1) {
        if (y>=17){
            cout << "Pria Dewasa";
        }
        else{
            cout << "Perjaka";
        }
    }
    else {
        if (y>=17){
            cout << "Wanita Dewasa";
        }
        else{
            cout << "Gadis";
        }
    }
}

int main(){
    int umur, kel;

    cout << "Jenis Kelamin" << '\n';
    cout << "1. Laki-Laki" << '\n';
    cout << "2. Perempuan" << '\n';
    cout << "Masukan Pilihan Anda (1-2): "; cin >> kel;

    cout << "Masukan Umur Anda (1-100): "; cin >> umur;

    Hasil(kel,umur);
getch();
}







#include Keyword, < opreator,  iostream.h Keyword, > oprator.
#include Keyword, < opreator, conio.h Keyword, >oprator.
void Keyword, Hasil identifier, ( Funtuation, int Keyword, x identifier, int Keyword, y identifier, Funtuation.
Keyword.
if Keyword, (  Funtuation, x identifier, == oprator, Literal, ) Funtuation,{ Keyword.
if Keyword, ( Funtuation, y identifier, > oprator, oprator, 17  Literal, ) Funtuation,{ Keyword.
cout Keyword, << opreator, " Funtuation, Pria Dewasa Literal, " Funtuation, ; Funtuation.
Keyword.
else Keyword, Keyword.
cout Keyword, << oprator, "Funtuation, Perjaka Literal, " Funtuation, ; Funtuation.
Keyword.
Keyword.
else Keyword, Keyword.
if Keyword, Funtuation, y identifier, >= oprator,17 Literal, ) Funtuation,{ Keyword.
cout Keyword, << oprator, Funtuation, Wanita Dewasa Literal, " Funtuation, ; Funtuation.
Keyword.
else Keyword,Keyword.
cout Keyword. << oprator, Funtuation,Gadis Literal, " Funtuation, ; Funtuation.
Keyword.
Keyword.
Keyword.
int  Keyword, main Keyword, ( Funtuation, ) Funtuation, { Keyword.
int Keyword, umur  Literal, kel Literal, Funtuation.
cout Keyword,<< oprator, " Funtuation, Jenis Kelamin Literal, " Funtuation, << oprator, '\n'; Funtuation,
cout Keyword,<< oprator, " Funtuation, 1. Laki Laki Literal, " Funtuation, << oprator, '\n'; Funtuation,
cout Keyword,<< oprator, " Funtuation, 2. Perempuan Literal, " Funtuation, << oprator, '\n'; Funtuation,
cout Keyword,<< oprator, " Funtuation, Masukan Pilihan Anda Literal, ( Funtuation, 1 Literal, - oprator, Literal, ) Funtuation, : oprator, "Funtuation, ; Funtuation, cin Keyword, >> kel Literal, Funtuation.
cout Keyword,<< oprator, "Masukan Umur Anda Literal, (  Funtuation, 1  Literal, - oprator, 100  Literal, )  Funtuation, : oprator, "Funtuation, ; Funtuation, cin  Keyword, >>  oprator, umur Literal, ; Funtuation.
Hasil identifier, ( Funtuation, kel Literal, umur Literal, );
getch Keyword, Funtuation, ) Funtuation, ; Funtuation,
Keyword.



Komentar

Postingan populer dari blog ini

Metode Parsing (Teknik Kompilasi)

ANALISA SEMANTIK