编程学习网为您整理以下代码实例,主要实现:C语言库div()函数,希望可以帮到各位朋友。
#include <stdio.h>
#include <stdlib.h>
int main () {
div_t output;
output = div(27, 4);
printf("QuotIEnt part of (27/ 4) = %d\n", output.quot);
printf("Remainder part of (27/4) = %d\n", output.rem);
output = div(27, 3);
printf("QuotIEnt part of (27/ 3) = %d\n", output.quot);
printf("Remainder part of (27/3) = %d\n", output.rem);
return(0);
}
本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!