int get_digits(int);// Function Prototype
/**********************************************************************************************/
main() // Beginning of Main Function
{
int no = 0;
printf("Please Enter Any Positive Integer\n");
scanf("%d",&no);
get_digits(no); // Function Calling by passing an argument as "no"
}// End of Main
/**********************************************************************************************/
int get_digits(int n)// Function Definition
{
int sum,mult,sub,remainder;
sum = sub = remainder = 0;
mult = 1;
double division = 1;
int temp = n;
while ( n > 0)
{
remainder = n % 10;
sum = sum + remainder;
sub = remainder - sub;
mult = mult * remainder;
division = division / (double)remainder;// type conversion remainder of type int
n = n / 10; //into double
}// WHILE
printf("---------------------------------------------\nSum of Digits of \t%11d = %d\n",temp,sum);
printf("Subtraction of Digits of \t%3d = %d\n",temp,sub);
printf("Multiplication of Digits of \t%3d = %d\n",temp,mult);
printf("Divsion of Digits of \t%11d = %lg\n---------------------------------------------\n\n",temp,division);
}