C Program to find modulus of two numbers

Description

```Get two integer numbers, divide both the integers and dispaly the remainder.
Sample Input 1:
6 5
Sample Sample Output 1:
1
Input2:
28 4
Output2:
0
```

Solution

```//Program to get remainder in division
#include<stdio.h>
int main()
{
int num1,num2,rem;
printf("Enter two numbers:");
scanf("%d %d",&num1,&num2);
rem=num1%num2;
printf("\nRemainder: %d",rem);
return  0;
}```

Explanation

```Get two integers a and b (using scanf statement)
divide a by b, then store quotient in c (c=a%b, Note "%" operator gives remainder)
print the value of c (using printf statement)```

Author - Ramesh P Natarajan

Learner, Professor, Technology Trainer, Software Developer and Content Marketer, very much passionate in the field of Software Application Development, Machine Learning and Search Engine Optimization.

Interesting Pattern Programs: for more Patterns

```Input:
5
Output:
*
**
***
****
*****
****
***
**
*Solution```
```Input:
5
Output:
*
***
*****
*******
*********
*******
*****
***
*Solution```
```Input:
5
Output:
*        *
**      **
***    ***
****  ****
**********Solution```
```Input:
5
Output:
*       *
**     **
***   ***
**** ****
*********Solution```
```Input:
5
Output:
*       *
**     **
***   ***
**** ****
*********
**** ****
***   ***
**     **
*       *Solution```
```Input:
5
Output:
*********
*******
*****
***
*
***
*****
*******
*********Solution```