Just Simple Guess Game

This item was filled under [ C++, Coding ]

#include <iostream.h>
int main()
{
int myBirthday = 13;
int guess;

cout << “Please guess the day of my birth, from 1 to 31″<<endl;
cout << “Enter your guess please”;
cin >> guess;

if (guess < 0)
{
cout << “Months don’t have negative day, Einstein!!”<<endl;
}
else if (guess>31)
{
cout << “Pretty long month, genius!!”>>endl;
}
else if (guess == myBirthday)
{
cout << “Incredible,, you are right. Congratulations..”<<endl;
}
else if (guess < myBirthday)
{
cout << “Higher” <<endl;
}
else
{
cout << “Lower” << endl;
}
return 0;
}

Posting Terkait

  • Tidak ada Posting Terkait
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Apa Pendapat Anda??

CommentLuv Enabled