Clown Town
Senior Member
My VERY first C++ code... i am just starting to learn the language...
<div class='spoiler_toggle'>Spoiler: click to toggle</div><div class="spoiler" style="display:none;">#include <iostream>
using namespace std;
int main ()
{
int i,y;
y=2009;
cout << "I can predict what year you will die... what year you born? ";
cin >> i;
cout << "Here are your stats ";
cout << " Year Born : " << i;
cout << " Age : " << y-i;
cout << " Year of Estimated Death : " << i+80 << ".\n";
return 0;
}</div>
If anyone is having trouble understanding what it does PM me... but if you know what cout and cin are that should not be a problem...
One major error for no apparent reason... when running the EXE it skips everything after the first cin and closes :/ i can only get it to run in Visual C++
So... if you know how to use C++ can you tell me if this is a good first script?
<div class='spoiler_toggle'>Spoiler: click to toggle</div><div class="spoiler" style="display:none;">#include <iostream>
using namespace std;
int main ()
{
int i,y;
y=2009;
cout << "I can predict what year you will die... what year you born? ";
cin >> i;
cout << "Here are your stats ";
cout << " Year Born : " << i;
cout << " Age : " << y-i;
cout << " Year of Estimated Death : " << i+80 << ".\n";
return 0;
}</div>
If anyone is having trouble understanding what it does PM me... but if you know what cout and cin are that should not be a problem...
One major error for no apparent reason... when running the EXE it skips everything after the first cin and closes :/ i can only get it to run in Visual C++
So... if you know how to use C++ can you tell me if this is a good first script?