Division Assignment in C++
Level 247 keystrokes
Divides x by 2 and then by 5 with /=, so 100 becomes 50 and then 10, and prints 10.
C++ code
// Initializes x with 1001int x = 100;// x /= 2 means x = x / 2: 100 / 2 = 502x /= 2;// 50 / 5 = 10; with ints any remainder would be dropped3x /= 5;// Prints the final value, 104cout << x << endl;Output
10
Practice typing this code. Results are not recorded in the rankings.
Symbols in this code
The symbols you type in this C++ code and how often they appear.
;× 4<× 4=× 3/× 2