Hasnain's Riddle Program
4 posters
CMPC :: Computing :: Programming :: C++
Page 1 of 1
Hasnain's Riddle Program
- Code:
#include<iostream>
#include<string>
#include<windows.h>
using namespace std;
int main ()
{ string a,b,c;
cout<<"bet you can't solve this riddle:";
cout<<'\n';
do
{
cout<<"type in two different numbers in which one is not greater than the other And the other is not greater than the first one"<<'\n'
<< "and you can't cheat by putting in the same number twice";
cout<<'\n';
cout<<"first number:";
cin>> a;
cout<<"second number:";
cin>>b;
if ((a>=b)&&(b>=a))
{cout<<"hey you cheater i said you can't use the same number twice";
Sleep(3000);
break;
}
cout<<"Haha you're wrong" <<'\n'<<"Do you give up:";
cin>>c;
}
while ((c!="yes")&&(a!=b));
cout<<'\n'<<"Awww Well You won. Albeit through negative means";
Sleep(6500);
cout<<'\n'<<"but did you really?";
Sleep(3000);
cout<<'\n' <<" you only won because you are a cheater and a quitter" <<'\n'<<"so in the end who really won?";
return 0;
}
zodiacescuchion- Skid
- Posts : 28
Re: Hasnain's Riddle Program
you could at least make a more specific title than "Program" in the programming section. Or maybe even given us a description of it before you posted the code.
Oh also good job in the code. You're learning But a biased opinion on my part, Do statements suck
Oh also good job in the code. You're learning But a biased opinion on my part, Do statements suck
Admin- Pirate King
- Posts : 559
Re: Hasnain's Riddle Program
i have to go to the end of it to see what's happening instead of just looking at line #1 of the loop (for loops have all the info in the first part so it's convenient)Corey wrote:What's wrong with Do statements?
Admin- Pirate King
- Posts : 559
Re: Hasnain's Riddle Program
Besides most people usually have some sort of preference.
Unchained- Mod
- Posts : 448
CMPC :: Computing :: Programming :: C++
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|