Welcome to Gaia! :: View User's Journal | Gaia Journals

 
 

View User's Journal

DC's Code
Day 2 - If Statement

//Basic if statement
//C++ general, Deathlycat
if ( TRUE ) {
// Execute these statements if TRUE
}
else {
// Execute these statements if FALSE
}


Now to implement it...


//Basic if statement
//C++ general, Deathlycat
if (x = 0) {
cout << "You loose!n";
}
else {
cout << "Hahaha...Wait, you won?n";
}


Outputs:
"You loose!" If you have 0 health.
Outputs:
"Hahaha...Wait, you won?" If you have at least 1 point oh health.





 
 
Manage Your Items
Other Stuff
Get GCash
Offers
Get Items
More Items
Where Everyone Hangs Out
Other Community Areas
Virtual Spaces
Fun Stuff
Gaia's Games
Mini-Games
Play with GCash
Play with Platinum