fork download
  1. #include <stdio.h>
  2.  
  3. int a,b;
  4. int resultq,resultr;
  5.  
  6. int main ()
  7. {
  8. printf ("Input the first value : ");
  9. scanf ("%d", &a);
  10. printf ("Input the second value : ");
  11. scanf ("%d",&b);
  12.  
  13. if(a<=0 ||b<=0){
  14. printf("First and Second value should be a positive value");
  15.  
  16. }
  17. else{
  18. resultq = b / a;
  19. resultr = b % a;
  20. printf("The quotient of the first and second value is: %d", resultq);
  21. printf("The remainder of the first and second value is: %d", resultr);
  22. }
  23. return 0;
  24. }
Success #stdin #stdout 0.01s 2684KB
stdin
2
10

stdout
Input the first value : Input the second value : The quotient of the first and second value is: 5The remainder of the first and second value is: 0