Advertisement
Guest User

Untitled

a guest
Dec 8th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.30 KB | None | 0 0
  1. int main() {
  2.  int source_number = 65; // the number that we need to check
  3.  
  4.  int decimal_digit = source_number/10; // the deciman digit (in our case it is 6)
  5.  int unit_digit = source_number - decimal_digit * 10; // the unit digit (in our case is 5)
  6.  printf("Dec %d, unit %d", decimal_digit, unit_digit);
  7. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement