Wednesday, November 21, 2018

If Statement

0 comments

If Statement

 if condition is true so execute statement otherwise next instruction execute.
            Syntax: -    If (condition)
                                {
                                  Statement;
                                 }

Example: - 
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
#include <stdio.h>
int main()
{
    int a = 20;
    int b = 22;
    if (a<b)
    {
    printf("Variable b is greater-than a");
    }
    return 0;
}

No comments:

Post a Comment