top of page

Programming by example

Coding Made Easy

MisterTootor  M.S., B.S., A.S., A.S.B

mistertooter's

/* Simple if statement */ https://c.happycodings.com/code-snippets/basic-simple-of-the-if-statement.html

 

#include <stdio.h>

 

 

 

void main()
{
   int number = 0;
   printf("\nEnter an integer between 1 and 10: ");
   scanf("%d",&number);

   if (number > 8)
     printf("You entered %d which is greater than 8\n", number);

   if (number < 4)
     printf("You entered %d which is less than 4\n", number);
}

​

​​ 

    Output:

​

        Enter an integer between 1 and 10: 2

        You entered 2 which is less than 4

​

​

bottom of page