Skip to main content

Division of two numbers

#include <stdio.h>
int main()
{
  int a,b,rem,quo;
  float finalresult;
  printf("Enter two numbers\t:\t");
  scanf("%d%d", &a , &b );
  quo=a / b;
  rem=a % b;
  finalresult=(float) a / b;
  printf("\nQuotient\t:\t%d", quo);
  printf("\nRemainder\t:\t%d", rem);
  printf("\nFinal Result\t:\t%f", finalresult);

  return 0;
}

Enter two numbers :  24 9

Quotient : 2
Remainder : 6
Final Result : 2.666667 

Comments