# Write a C Program to Compute Quotient and Remainder?

**Write a C Program to Compute Quotient and Remainder?**

#include <stdio.h>

int main()

{

int dividend, divisor, quotient, remainder;

printf("Enter dividend: ");

scanf("%d", ÷nd);

printf("Enter divisor: ");

scanf("%d", &divisor);

// Computes quotient

quotient = dividend / divisor;

// Computes remainder

remainder = dividend % divisor;

printf("Quotient = %d\n", quotient);

printf("Remainder = %d", remainder);

return 0;

}

**Output:**

Enter dividend: 25

Enter divisor: 4

Quotient = 6

Remainder = 1

**Explanation:**

This is a simple program where the user enters two integers which are stored as variable *dividend* and *divisor* respectively. Then the quotient is calculated using the division/operator and the result is stored in the variable *quotient*.

Similarly, the remainder is calculated using modulus % operator and stored in the *remainder* variable.

Finally, the quotient and remainder are displayed using *printf()* function.

Related Topic:Write a C Program to Multiply Two Numbers using User input?

**For Video Explanations Check Out Our **__Playlist on Youtube HERE.__

__Playlist on Youtube HERE.__

__#Interview__ #Preperation #Placement #OffCampusing #Engineering #OnCampus #PrivateJobPreperation #JobPreperation#CodingPreperation #AMCAT #Automata #JobsforGraduates #HighestPayingJobsforGraduates

#coding #codinglife #codingisfun #codingproblems #CoffeeWithCodes #CWC #Cprogramming #cprogramminglanguage #competitiveprogramming