Write a program to calculate Compute Quotient and Remainder.
C Program
#include <stdio.h>int main(){int divident, divisor;int quotient, remainder;printf("Enter divident value : ");scanf("%d", ÷nt);printf("Enter divisor value : ");scanf("%d", &divisor);quotient = divident / divisor;remainder = divident % divisor;printf("Quotient is %d\n", quotient);printf("Remainder is %d\n", remainder);return 0;}
Example:
Enter divident value : 22
Enter divisor value : 7
Example:
Quotient is 3
Remainder is 1
No comments:
Post a Comment