1 / 4
2 / 4
3 / 4
4 / 4

Thursday, 23 March 2023

Modulus of two Integers in C Program

 



In C Programming Language Modulus means the remainder value of a division operation.
To get this value in C programming we use the % (percentile) symbol.
Let's do coding to get the modulus of two numbers.

#include<stdio.h>
int main(){
    int num1,num2;
    printf("Enter 1st Number : ");
    scanf("%d",&num1);
    printf("Enter 2nd Number : ");
    scanf("%d",&num2);
   
    printf("Modulus of %d and %d is : %d",num1,num2,num1%num2);
    return 0;
}
Run the above code on Code Editor and Try.


Other Links:


No comments:

Post a Comment

If you have any doubts please let me know