CMPC
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Hasnain's Riddle Program

4 posters

CMPC :: Computing :: Programming :: C++

Go down

Hasnain's Riddle Program Empty Hasnain's Riddle Program

Post by zodiacescuchion Thu Feb 11, 2010 4:22 am

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
zodiacescuchion
Skid

Posts : 28

Back to top Go down

Hasnain's Riddle Program Empty Re: Hasnain's Riddle Program

Post by Admin Thu Feb 11, 2010 4:40 am

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 Very Happy But a biased opinion on my part, Do statements suck Razz
Admin
Admin
Pirate King

Posts : 559

Back to top Go down

Hasnain's Riddle Program Empty Re: Hasnain's Riddle Program

Post by Unchained Thu Feb 11, 2010 6:40 am

Yea looks pretty good, who is this?
Unchained
Unchained
Mod

Posts : 448

Back to top Go down

Hasnain's Riddle Program Empty Re: Hasnain's Riddle Program

Post by Corey Fri Feb 12, 2010 2:07 am

What's wrong with Do statements?
Corey
Corey
Mod

Posts : 462

Back to top Go down

Hasnain's Riddle Program Empty Re: Hasnain's Riddle Program

Post by Admin Fri Feb 12, 2010 2:35 am

Corey wrote:What's wrong with Do statements?
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)
Admin
Admin
Pirate King

Posts : 559

Back to top Go down

Hasnain's Riddle Program Empty Re: Hasnain's Riddle Program

Post by Corey Fri Feb 12, 2010 2:40 am

yeah that's true
Corey
Corey
Mod

Posts : 462

Back to top Go down

Hasnain's Riddle Program Empty Re: Hasnain's Riddle Program

Post by Unchained Fri Feb 12, 2010 6:11 am

Besides most people usually have some sort of preference.
Unchained
Unchained
Mod

Posts : 448

Back to top Go down

Hasnain's Riddle Program Empty Re: Hasnain's Riddle Program

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

CMPC :: Computing :: Programming :: C++

 
Permissions in this forum:
You cannot reply to topics in this forum