Ok I just started C++ yesterday. Im somewhat familiar of how it works as I know html, css and a little bit of PHP.
So yesterday all I did was read through all the articles I could find about C++ and I waited until today until really starting to learn. I went through the first begginer tutorial teaching you about variables, input and output(I though it was very well written and clear by the way).
So I decided before I go onto a harder thing I will try making something with that I learned
Know what it does is ask you this quest.
How old are you: and you type in the answer here
Ok so you are: Right here it says a number 8 higher than the one you entered.
Is that how old you are?: Now you should type in no and itl say
O sorry so how old are you?: and you type in your age
O so your _? I must have misread it last time: and thats the end
Now my problem is when it gets to the part where its suppores to say o sorry so how old are you the window just closes down.
I had a few other problems but I fixed them. Also when I compile it it no errors come up. I'v been experimenting for about 30 minutes and can't find a solution.
Heres my code
Code:
#include <iostream>
using namespace std;
int main()
{
int thisisanumber;
cout<<"please enter your age: ";
cin>> thisisanumber;
cin.ignore();
cout<<"so your: "<<8+thisisanumber <<"\n";
int no;
cout<<"is that how old you are?: ";
cin>> no;
cin.ignore();
cout<<no <<"your not " <<"\n";
int real;
cout<<"Sorry I must of misheard you. So what is your real age then?: ";
cin>> real;
cin.ignore();
cout<<"O , ok so your"<< real <<"\n";
cout<<"Well thanks for spending this time with me even though"<<"\n";
cout<<"I am just a computer programm" <<"\n";
}