If - Else & Else-If condition

Suman Barik
0

#include <iostream>


int main() {

  

  int age = 6;

  

  if (age >= 3 & age < 6) {

     std::cout << "You can go to pre-primary school";

  }

  

  else if (age >= 6 & age < 10) {

     std::cout << "You can go to primary school";

  }

  

  else if (age >= 10) {

      std::cout << "You can go to high school";

  }

  

  else {

      std::cout << "You are a toddler";

   }

   

   return 0;

   

}

Post a Comment

0Comments
Post a Comment (0)