I got one type of questions, I did it right but one thing I couldn't know how to do it, actually I am not that good in math so I couldn't find a right equation for it.
Question says:
Write a program that reads a positive integer number of any digit size and do the following:
a. Print the sum of its digits.
b. Print the average of its digits.
c. Print the leftmost digit.
d. Print the maximum digit.
If the input number is negative, convert it to positive.
And this is a sample of Input/Output:
Enter a positive integer: 1246
The Sum is 13
The average is 3.25
The leftmost digit is 1
The maximum is 6
Well, I did it all except (c), I couldn't find a proper equation to find leftmost digit.