Back To C Flow of Control Index
if remainder of a divided by b is equal to zero, a is divisible by b else a is not divisible by b
//program to input two numbers a and b and check whether a is divisible by b or not using if-else statement #include
#include
void main() { int a,b; clrscr(); printf("enter value for a"); scanf("%d",&a); printf("enter value for b"); scanf("%d",&b); if(a%b==0) { printf("a is divisible by b"); } else { printf("a is not divisible by b"); } getch(); }