← C# from Scratch
Lesson 6 of 39 · 5 XP
Warm-up: a number from the input warm-up
Theory and problem statement
Machine translation, not yet reviewed by a native speaker.
Console.ReadLine() reads a line. To do maths, turn the line into a number with int.Parse:
int n = int.Parse(Console.ReadLine());
Console.WriteLine(n * 2);
Task. Read an integer and print it multiplied by 2.
Sign up for free to solve this task right in your browser: code editor, running, test checks and hints.