-
June 16th, 2010, 08:10 PM
#1
HELP! need assistance on C++ project
Ok so I have a C++ project due tomorrow and I am stuck. I am also a completely new to C++ and programming in general so if you can tell me the necessary code and where to put it it would help ALOT.
#include "stdafx.h"
#include <iostream>
using namespace std;
int main()
{ int i;
i = 1;
cout << "Wanna test how smart you are? \n";
cout << "ThEn LeT's PlAy ThE sMaRt GaMe! \n";
cout << "What's "<<i<<"*"<<i<<"? \n";
int guess;
cin >> guess;
int num;
num = (i+1)*(i+1);
if (guess == num);
cout << "WoW! i NeVeR tHoUgHt YoU wErE sO sMaRt! \n";
cout << "TIME FOR LEVEL "<<i<< " ! \n";
cin.get()
return 0}
I am using the basic header files with Visual Studio '10. Basically, what I want this program to do is play this code but i want it to have a loop that adds 1 to integer i after every time it loops (it will loop continuously). I also want an else if statement that will send the player back to level one and resets the integer i back to 1, and repeat the process. Any help will be greatly appreciated.
-
June 17th, 2010, 12:37 PM
#2
Re: HELP! need assistance on C++ project
Use while(true) for infinite loop
henky
----------------------------------
henky@nok.co.id is not my email address anymore...
Jangan Pernah Menyerah
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|