C - Programming Language
This course covers the basics of programming in C. Work your way through the videos and we'll teach you everything you need to know to start your programming journey!

If Statements

Lesson 18
Author : Mike Dane
Last Updated : November, 2017


Code

Copyint isStudent = 0;
int isSmart = 0;

if(isStudent != 0 && isSmart != 0){
     printf("You are a student\n");
} else if(isStudent != 0 && isSmart == 0){
     printf("You are not a smart student\n");
} else {
     printf("You are not a student and not smart\n");
}

// >, <, >=, <=, !=, ==
if(1 > 3){
     printf("number comparison was true\n");
}

if('a' > 'b'){
     printf("character comparison was true\n");
}