//game tebak-tebakan Judul program #include <iostream> header program C++ yang menyimpan bahasa program #include <string>

header program C++ untuk kumpulan karakter #include <conio.h> header program C++ yang menyimpan bahasa program using namespace std; berupa header untuk menyesuaikan dengan header yang lainnya void main () fungsi program { int ang = 'C'; nilai ang integer = C bilangan ascii string name; string untuk nama int age; age integer int num; num integer int i; i integer cout << " enter your name please : " ; cin >> name; output dan masukan untuk nama cout << "this game is not for under 21+ years old! "; output "this game is not for under 21+ years old! cout << "\n" << name << " , how old are you ? "; cin >> age; ouput nama , " , how old are you ? , masukan umur if ( age<21) goto out; jika umur kurang dari 21 maka program berakhir cout << "\ngame is starting =================\n"; output game is starting ================= ang = (ang-age)/2; nilai ang = ang - age ,lalu dibagi 2 cout <<" i have one number \n"; output i have one number do { cout <<"what is your guess? (0-10) "; cin >> num; output dan masukan nilai num if ( num == ang ) break; jika num sama dengan ang maka program selesai cout << " owh ,,,, sorry!" << endl; output " owh ,,,, sorry!" }

penutup fungsi } . (i--). while dengan (i=3). output game is over !! my number is ang getch (). (i>=1).while (i=3). (i>=1). (i--) out: keluar cout << "\ngame is over !! my number is " << ang.

Sign up to vote on this title
UsefulNot useful