P. 1
Game Tebak

Game Tebak

|Views: 28|Likes:
Published by Anggri Yulio P

More info:

Published by: Anggri Yulio P on Feb 18, 2012
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less

05/24/2012

pdf

text

original

//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!" }

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

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->