Print message if input is less than 5 - C Statement

C examples for Statement:if

Description

Print message if input is less than 5

Demo Code

#include <stdio.h>
#include <stdlib.h>
int main()//w ww.jav  a 2s. c o m
{
   char num[2];
   int number;
   printf("Enter a number from 0 to 9:");
   gets_s(num);
   number=atoi(num);
   if(number<5)
   {
      printf("That number is less than 5!\n");
   }
   printf("done!\n");
   return(0);
}

Result


Related Tutorials