C Programming

C – Read Two Numbers, Check First Number Divisible by Second or Not

Write a c program to read any two numbers, check first number is divisible by second or not.

C Code

#include<stdio.h>
#include<conio.h>

void main()
{

int first, second;

printf("nEnter two numbers:");
scanf("%d%d",&first, &second);

if(first%second==0)
printf("nFirst is divisible by second number");
else
printf("nNot divisible");

getch();

}

Output

Back to top button