code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
| #include <iostream.h>
int main() //Most important part of the program!
{
int age; //Need a variable...
cout<<"Hoe oud ben je?: "; //Asks for age
cin>>age; //The input is put in age
if(age<100) //If the age is less than 100
{
cout<<"Je bent nog heel erg jong!"; //Just to show it works
}
else if(age==100) //I use else just to show an example
{
cout<<"Jij bent egt oud"; //Just to show you it works...
}
else
{
cout<<"oud!"; //Executed if no other statement is executed
}
return 0;
} |
kijk, als ik dit heb, of met andere code, dan kan je dus een leeftijd invoeren, maar zodra je op enter drukt, sluit de prog af?
weet iemand hoe ik dat kan oplossen?
want zo zie je bijvoorbeeld niet "Je bent nog heel erg jong"