Академический Документы
Профессиональный Документы
Культура Документы
C++ :
The
Hangman
Submitted By
Submitted to
Sagar Rawat
Class 11th Sci
Roll no. 15
Acknowledgeme
nt
I would like to express my special thanks of gratitude to my
Computer Teacher
as well as our Principal
who gave me the golden opportunity to do this wonderful
project of Computer Science which also helped me in doing a lot
of Research and I came to know about so many new things I am
really thankful to them.
Secondly I would also like to thank my parents and friends who
helped me a lot in finalizing this project within the limited time
frame.
#include <iostream.h>
#include <stdlib.h>
#include <string.h>
#include <conio.h>
int main ()
{
char unknown [MAXLENGTH];
char letter;
int num_of_wrong_guesses=0;
char word[MAXLENGTH];
char words[][MAXLENGTH] =
{
"india",
"pakistan",
"nepal",
"malaysia",
"philippines",
"australia",
"iran",
"ethiopia",
"oman",
"indonesia"
};
}
if(num_of_wrong_guesses == MAX_TRIES)
{
cout << "\nSorry, you lose...you've been hanged." << endl;
cout << "The word was : " << word << endl;
}
getch();
return 0;
}
/* Take a one character guess and the secret word, and fill in the