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!

If Statements

Lesson 16
Author : 🦒
Last Updated : November, 2017


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; }