This question is broken into 3 parts, each of which builds on the functions developed in the previous part. Note that you can (and should) still answer parts (b) and (c) even if you cannot answer the preceding parts - just assume that the functions work as they should, and continue.
Please explain the code as well
* C Program to Find Sum of First and Last Digit Of a Number
*/
#include <stdio.h>
#include <math.h>
int main()
{
int Number, FirstDigit, Count, LastDigit, Sum =
0;
printf("\n Please Enter any Number that you wish :
");
scanf("%d", & Number);
Count = log10(Number);
FirstDigit = Number / pow(10, Count);
LastDigit = Number % 10;
Sum = FirstDigit + LastDigit;
printf(" \n The Sum of First Digit (%d) and Last Digit
(%d) of %d = %d", FirstDigit, LastDigit, Number, Sum);
return 0;
}
Get Answers For Free
Most questions answered within 1 hours.