Modular operator in c ( Chapter 1 Program 9)

Also visit our YouTube Channel Tech Eos    VISIT CHANNEL



/*  9. Write a program to enter a number and carry out modular division
operation by 2, 3 and 4 and display the remainders */

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

void main()
{
int number ;

clrscr();

printf("Enter an number : ");
scanf("%d" , &number);

printf("\nModular Division 2 of %d is %d" , number , number%2);
printf("\nModular Division 3 of %d is %d" , number , number%3);
printf("\nModular Division 4 of %d is %d" , number , number%4);

getch();
}



 

Comments

Popular posts from this blog

Maximum from three numbers (Nested If ) (Chapter 2 Program 2 )

( Chapter 2 Program 7 )