3.1.The if Statement
The if statement used for one condition that it’s will process if condition true and will do nothing when condition false.
Syntax 1:
if(condition) statement 1;
Syntax 2:
if(condition) { statement 1; ... statement n; }
Example 1:
#include<iostream.h> #include<conio.h> void main() { float score; cout<<"Enter Score: "; cin>>score; if(score>=50) cout<<"Passed"; getch(); }