Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

c programme to check given no is multiple of 2,4,8 by nested if

–1 vote
asked Oct 10, 2018 by pavankumar (110 points)

1 Answer

0 votes
answered Jan 22, 2019 by Jyothi_Rk
#include <stdio.h>

void main()
{
    int num;
    printf("Enter number\n");
    scanf("%d",&num);
    if(num%2 ==0)
    {
        printf("Num is multiple of 2");
        if(num%4 ==0)
        {
            printf(",4");
            if(num%8 ==0)
               printf(" and 8\n");
            else
               printf("\nBut Num is not a multiple of 8\n");
        }
        else
            printf("\nBut Num is not a multiple of 4 and 8\n");
    }
    else
         printf("Num is not a multiple of 2,4 and 8\n");
}
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...