Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

fun fun C++

Name: Anonymous 2009-09-04 20:46

#include <stdlib.h>
#include <iostream>

using namespace std;

int main() { int number=rand()%100;
int guess=-1;
int trycount=0;
while(guess!=number && trycount<8) {
    cout<<"Please enter a guess: ";
    cin>>guess;
    if(guess<number) cout<<"Too low"<<endl;
    if(guess>number) cout<<"Too high"<<endl;
    trycount++;
    }
if(guess==number) cout<<"You guessed the number";
else cout<<"Sorry, the number was: "<<number;
return 0;
}

Name: Anonymous 2009-09-04 20:53

I see 3 problems with your post:
First, there was no code tags (can we get a sticky or something?)
Secondly, it was written in C++
and Thirdly, this trivial shit belongs in /pr/

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List