Write a flowchart to find out sum of first and last digit of a given number.
Answers
Answered by
4
Input a number from user. Store it in some variable say (num).
To find last digit of given number we modulo divide the given number by 10. Which is (lastDigit = num % 10).
To find first digit we divide the given number by 10 (till num is greater than 0)
Finally calculate sum of first and last digit i.e. (sum = firstDigit + lastDigit)
HOPE IT HELPS YOU
PLZ MARK AS BRAINLIEST
To find last digit of given number we modulo divide the given number by 10. Which is (lastDigit = num % 10).
To find first digit we divide the given number by 10 (till num is greater than 0)
Finally calculate sum of first and last digit i.e. (sum = firstDigit + lastDigit)
HOPE IT HELPS YOU
PLZ MARK AS BRAINLIEST
Attachments:
Similar questions