1234
1234
5
Repeatedly divide the number by 10 and store the remainder (the modulo). By way of an example, if the number were 12345: 12345 % 10 = 5 (first digit) 12345 / 10 = 1234 1234 % 10 = 4 (second digit) 1234 / 10 = 123 123 % 10 = 3 (third digit) 123 / 10 = 12 12 % 10 = 2 (fourth digit) 12 / 10 = 1 (fifth digit) This algorithm forms the basis of number reversals. The following function demonstrates the most efficient way of reversing any number in the range -2,147,483,648 to 2,147,483,647, inclusive. int RevNum( int num ) { const int base = 10; int result = 0; int remain = 0; do { remain = num % base; result *= base; result += remain; } while( num /= base); return( result ); }
#include <stdio.h> int main (void) { puts ("1 22 333 4444 55555"); return 0; }
1234 5678 9012
cheat
4000 1234 5678
Account Number 4000 1234 5678 9010 123 DEBIT VISA Good Thru 12/23
4000 1234 5678 9010
5678 + 69022 = 74700
42+5678 = 5720
5678 + 7467 = 13,145
5678 + 2987 = 8,665
7908 + 5678 = 13,586
1234 + 1234 = 2468
Using the country and area code, then the actual number: +52 (area code) (number) For instance, to call a number in Monterrey, Mexico: +52 (81) 1234 5678 Or to call someone from Mexico City: +52 (55) 1234 5678