Repeat until 0 (Do While) - Practice Exercises C# Sharp Lesson 2: Flow Control Exercise 2.7: Repeat until 0 (Do While) Objetive: Create a C# program to ask the user for a number "x" and display 10*x. It must repeat until the user enters 0 (using "do-while"). Source Code: C# JAVA using System; public class Exercise022 { public static void Main() { int number; do { Console.Write("Enter a number: "); number = Convert.ToInt32(Console.ReadLine()); Console.WriteLine(number * 10); } while (number != 0); } } Copy Exercise to ClipBoard Copy Code to ClipBoard Exercisey 2.7
More exercises for Lesson 2 << Previous 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 Next >>