The tricky part is getting the individual digits. There are basically two ways to do this: 1) Convert the number to a string, and use string manipulation to get the individual digits. 2) Repeatedly divide the number by 10. The digit is the remainder (use the "%" operator).
To actually get the highest digit, initially assume that the highest digit is zero (store this to a variable, called "maxDigit" or something similar). If you find a higher digit, replace maxDigit by that.
x -=y;
Use an enum if you are using a c style language. Or a map data structure. Assign each integer an English value and then match it to what the user inputs.
Use the MOD operator to get the remainder of integer division.
Reference:cprogramming-bd.com/c_page1.aspx# array programming
Here is a simple FORTRAN code to calculate the factorial of a given non-negative integer: program factorial implicit none integer :: n, result print *, "Enter a non-negative integer:" read *, n result = 1 if (n < 0) then print *, "Factorial is not defined for negative numbers." else do i = 1, n result = result * i end do print *, "Factorial of", n, "is", result end if end program factorial This program prompts the user for an integer, checks if it's non-negative, and then calculates the factorial using a loop.
see the program
x -=y;
1 hour ago my c program said no, but now I know 5 actually is an integer!
Any program whose output is: " Don't waste your time! There is no highest number. Never was, never will be."
Use %o
Not counting sports programming, for the 2014-2015 fall season, Empire was the highest ranked program for the 18/49 demo & The Big Bang Theory was the highest viewed program.
Use an enum if you are using a c style language. Or a map data structure. Assign each integer an English value and then match it to what the user inputs.
afi 31-101
Use the MOD operator to get the remainder of integer division.
The person or program that solves the equation does.
Reference:cprogramming-bd.com/c_page2.aspx# reverse number
A VPP Star is the highest level of recognition in the OSHA Voluntary Protection Program