If Statements

Lesson 16
Author : Afrixi
Last Updated : November, 2017


C++ - Programming Language
This course covers the basics of programming in C++. Work your way through the videos/articles and I'll teach you everything you need to know to start your programming journey!
<ul>
  <li>Is a false Boolean expression</li>
</ul>
<ul>
  <li>Is a true Boolean expression</li>
</ul>

if(isStudent && isSmart){ cout << "You are a student" << endl; } else if(isStudent && !isSmart){ cout << "You are not a smart student" << endl; } else { cout << "You are not a student and not smart" << endl; }

// >, <, >=, <=, !=, == if(1 > 3){ cout << "number comparison was true" << endl; }

if('a' > 'b'){ cout << "character comparison was true" << endl; }

string myString = "cat"; if(myString.compare("cat") != 0){ cout << "string comparison was true" << endl; }