Multiplication Assignment in C

Level 257 keystrokes

Multiplies value (5) by 3 with the compound assignment operator *= and prints "Result: 15".

C code

// value starts at 5
1int value = 5;
// *= multiplies the variable by the right side: value = value * 3, now 15
2value *= 3;
// Prints "Result: 15"
3printf("Result: %d\n", value);

Output

Result: 15
Practice typing this code

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.

  • ;× 3
  • "× 2
  • =× 2
  • ,× 1
  • :× 1
  • (× 1
  • )× 1
  • *× 1
  • \× 1
  • %× 1

More C examples at level 2

← C typing practice