c program to compute quotient and remainder || Arithmetic programs || C programming
In this, we are going to write a simple program for finding  quotient and remainder of two numbers in C.
#include <stdio.h>
int main()
{
	int num1, num2, quotient = 0, remainder = 0;

	// Ask user to enter the two numbers
	printf("Enter two numbers A and B : \n");

	// Read two numbers from the user || A = 17, B = 5
	scanf("%d%d", &num1, &num2);

	// Calclulate the quotient of A and B using '/' operator
	quotient = num1 / num2;

	// Calclulate the remainder of A and B using '%' operator
	remainder = num1 % num2;

	// Print the result
	printf("Quotient when A/B is: %d\n", quotient);
	printf("Remainder when A/B is: %d", remainder);

	return 0;
}
//.....Coded by JAIDEEP JAMBLE
#ENJOY CODING

Post a Comment

FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP

Previous Post Next Post