Tuesday, March 5, 2024

43. Input a number and check it is divisible by 3 or not :—

43. Input a number and check it is divisible by 3 or not :—


#include<stdio.h>

int main()

{

    int n;

    printf("enter a value of n ");

    scanf("%d",&n);

    if(n%3==0)

    {

        printf("divisible by 3");

    }

    else

    {

        printf("not divisible by 3");

    }

    return 0;

}


No comments:

Post a Comment