Today I am going to explain you what “if” is for in c++.

Here’s a video done by myself for you:

And now here’s a simple code example:

#include <iostream>
using namespace std;
int hours;
int main()
{
cout<<“How many hours of study do you need to approve?”;
cin>>hours;
if (hours>5)
cout<<“You should start now”<<endl;
return 0;
}

CC BY 4.0 Use of the conditional “if” by Mferflores is licensed under a Creative Commons Attribution 4.0 International License.