I wrote a program that will allow the user to guess a character from a to z.But the program does not compiled.I m using Dev C++(Bloodshed).Tell me whats wrong with the program???
//This program allows the user to guess a character from a to z
//do-while construct is used to allow five tries for guessing
#include<iostream.h>
main()
{
//declare & initialize variables
int tryNum=0;
char c;
//do-while construct
do
{
cout<<"Please enter the character from a to z for guessing: ";
cin>>c;
//check the entered character for equality
if(c=='z')
{
cout<<"congratulations, your guess is correct.";
tryNum=6;
}
else
{
tryNum=tryNum+1;
}
}
while(tryNum<=5)
}