• Language

    C

  • Description

    It accepts a number and displays whether it is divisible by 5 and 6 or both 5 or 6.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <stdio.h>
#include <stdlib.h>

int main (void)
{
    int number;
    printf ("Enter the value of number: ");
    scanf ("%d", &number);
    (void) getchar ();
    if(number%5==0)
        printf ("It is divisible by 5.\n");
    if(number%6==0)
        printf ("It is divisible by 6.\n");
    putchar ('\n');
    system ("pause");
    return EXIT_SUCCESS;
}