Check number is less than 10 - C Program

C program to check entered number is less than 10.

Solution:

In this program, the user enters any number as an input. This number is checked with 'if' statement. If entered number is less than 10 then statement under 'if' statement print a message and if the number is not less than 10 then it does not print any message.

#include<stdio.h>
int main()
{
     int num;
     printf("Enter Any Number : ");
     scanf("%d",&num);
     if(num<10)
          printf("\n%d is Less Than 10",num);
     return 0;
}


Note: Here, under the if statement, there is only one statement. Hence, { } curly braces are optional. When we need more statements under if then curly braces are mandatory.

Output:

number less than ten