Advertisement
valve2

div 2 int's and prnt quotient and remainder

Jan 18th, 2023 (edited)
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.42 KB | Source Code | 0 0
  1. // this program div 2 int's and gives the quotient and remainder
  2. // 9 and 4 will be used for testing
  3. #include <stdio.h>
  4. int A, B, end;
  5. float end2;
  6. int main(void) {
  7.     printf("Enter the dividend\n");
  8.     scanf_s("%d", &A);
  9.     printf("Enter the divisor\n");
  10.     scanf_s("%d", &B);
  11.     end = A / B;
  12.     printf("the quotient is ");
  13.     printf("%d", end);
  14.     printf("\n");
  15.  
  16.     end2 = A % B;
  17.     printf("the remainder is ");
  18.     printf("%f", end2);
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement