Write a C program to find remainder of two numbers.

TASK -

Get two numbers X and Y from the user and print the remainder of x%y.

Expected Output:

In C programming we are facilitated with many operation among those % is used to find remainder of two numbers: here is the program.

CODE:

#include<stdio.h>
int main(){

int x,y,remainder;

printf("Enter the Numbers \n"); 
printf("X: ");
scanf("%d",&x);
printf("\n");
printf("Y: ");
scanf("%d",&y);
remainder=x%y; //When x is divided by y there must be a remainder 0 or greater than 0
printf("\nThe remainder %d ",remainder);

getchar();
return 0;
}

NEED WORK PRODUCE WORK

My name is Abdul Rehman I am from Pakistan. I am doing BS in Computer and information sciences. Currently, I am creating these blogs to help students of computer sciences all over the world..

2 Comments

Post a Comment
Previous Post Next Post