pages

Thursday, 8 April 2021

c-program | program to check weather the number is divisible by 4,6,9 in c-programming

 program to check weather the number is divisible by 4,6,9 in c-language.

In this program , we will now allow user to take input from the user and check weather a number is divisible by 4,5,9 in c-programming.

If a number is divisible by any number it remainder should be zero.


#include<stdio.h>
#include<conio.h>
main()
{
    int x;
    printf("enter a number");
    scanf("%d",&x);
    if(x%6==x%9==x%4==0)
        printf("%d is divisible by 6,9 and 4",x);
    else
        printf("%d is not divisible by 6,9 and 4",x);
    getch();
}

output :-
       56= is divisible by 4,6,9 







For more c-programming :-

1.c-program to check weather a number is divisible by 2,3,9

2.c-program to print even and odd number from 1 to n natural number.








No comments:

Post a Comment