Q1 -
how can i reads an integer number then print the least significant digit and the next least significant digit.
e.g
enter entger: 142263
the least significant digit is :3
the next least significant digit is: 6
Q2-
how can i calculate the Fahrenheit according to the following equation
Fahrenheit = Celsius + 32
1.
It might be easier to read the integer as a string. Then you can access the digits as character elements in the string.
If you read it as an integer you will have to do the math. Hint: You will probably want to use the division / and modulo % operators.
2.
If you know the degrees Celsius you just have to add 32 to get the Fahrenheit. That's what the formula says.
I think you should try. You'll learn more that way.
At the moment your questions are very broad and it's almost as if you ask us to do the homework for you, which we will not do. If you can't get it to work after you have tried, at least you will have some code to show us and we can help with the more specific problems that you are facing.
Why should the code be deleted? If you have learnt something from it, others may too.
I know that this is homework; but the only people who would be upset by the code are 'career' teachers (usually pretty poor ones) who believe that:
There is absolutely nothing that can be learned from code written by someone else.
No student is interested in learning; every one of them would do a blind copy and paste job without any attempt at understanding. (The poorer the teacher, the higher the percentage of students for whom this this assumption tends to be be true.)
The overriding purpose of education is evaluation of knowledge, rather than the acquisition of knowledge.
IMGO, they should just be ignored (with the contempt that they deserve).