#include <iostream.h> // include een headerfile
int main() // main functie
{
cout <<"Hello world!\n"; // uitvoer gevolgd door newline
return 0; // sluit het programma af
}
Die doet hij niet... bij dev C++
Ik heb dit Hello World voorbeeld zo van internet gekopieerd, en hij flitst alleen een keer, en hij is weer weg...
Wat is er fout?
En waarom is deze dan wel goed:
#include <iostream.h>
int main() //Most important part of the program!
{
int age; //Need a variable...
cout<<"Please input your age: "; //Asks for age
cin>>age; //The input is put in age
if(age<100) //If the age is less than 100
{
cout<<"You are pretty young!"; //Just to show it works
}
else if(age==100) //I use else just to show an example
{
cout<<"You are old"; //Just to show you it works...
}
else
{
cout<<"You are really old"; //Executed if no other statement is executed
}
return 0;
}
???
Kan iemand me helpen?
Alvast bedankt
int main() // main functie
{
cout <<"Hello world!\n"; // uitvoer gevolgd door newline
return 0; // sluit het programma af
}
Die doet hij niet... bij dev C++
Ik heb dit Hello World voorbeeld zo van internet gekopieerd, en hij flitst alleen een keer, en hij is weer weg...
Wat is er fout?
En waarom is deze dan wel goed:
#include <iostream.h>
int main() //Most important part of the program!
{
int age; //Need a variable...
cout<<"Please input your age: "; //Asks for age
cin>>age; //The input is put in age
if(age<100) //If the age is less than 100
{
cout<<"You are pretty young!"; //Just to show it works
}
else if(age==100) //I use else just to show an example
{
cout<<"You are old"; //Just to show you it works...
}
else
{
cout<<"You are really old"; //Executed if no other statement is executed
}
return 0;
}
???
Kan iemand me helpen?
Alvast bedankt