C examples for Statement:if
Print message if input is less than 5
#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); }