C Program for Integer Division and Remainder, Exercises of Computer Engineering and Programming

A c program code for calculating the quotient and remainder of an integer division operation. The user is prompted to input the dividend and divisor, and the program displays the quotient and remainder. The user can choose to continue the calculation by entering 'y' or exit by entering 'n'.

Typology: Exercises

2011/2012

Uploaded on 07/28/2012

dewansh
dewansh 🇮🇳

4.4

(10)

89 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
5
#include<stdio.h>
#include<conio.h>
void main (void)
{
int num,div;
float rem,quo;
char a;
clrscr();
do
{
printf ("\nEnter the divident\n");
scanf ("%d",&num);
printf ("Enter the divisor\n");
scanf ("%d",&div);
rem=num%div;
quo=num/div;
printf ("The remainder is: %f",rem);
printf ("The quotent is: %f",quo);
printf ("Do you want to continue (y/n)?\n");
a=getche();
}
while (a=='y');
getch();
}
Remainder
docsity.com

Partial preview of the text

Download C Program for Integer Division and Remainder and more Exercises Computer Engineering and Programming in PDF only on Docsity!

#include<stdio.h> #include<conio.h> void main (void) { int num,div; float rem,quo; char a; clrscr(); do { printf ("\nEnter the divident\n"); scanf ("%d",&num); printf ("Enter the divisor\n"); scanf ("%d",&div); rem=num%div; quo=num/div; printf ("The remainder is: %f",rem); printf ("The quotent is: %f",quo); printf ("Do you want to continue (y/n)?\n"); a=getche(); } while (a=='y'); getch(); }

Remainder

docsity.com