C - Write program to remove the braces from single line if statement

Requirements

Write program to remove the braces from single line if statement

Hint

When only one statement belongs to an if statement, the braces are optional.

Demo

#include <stdio.h>

int main()//from  w  ww . j a v  a  2 s  .  c  o  m
{
    int a,b;

    a = 6;
    b = a - 2;

    if( a > b)
        printf("%d is greater than %d\n",a,b);
    return(0);
}

Result

Related Exercise