1. Course
  2. Flow controls B
  3. Switch, break and default

Switch, break and default


Last updated: 8/22/2020 Difficulty: Easy

Create a C# program that calculates a student's grade from an integer. Ask the user for a number (x) and answer the following:

  • 10 - A+
  • 9 - A
  • 7,8 - B
  • 6 - C
  • 5 - E
  • 0,4 - F

Use the switch, break and default instruction of C#.

Input

  1. 10

Output

  1. A+

Solution

Flow controls B

6 / 8

Android App


Practice C# anywhere with the free app for Android devices.

Android App

Exercises C# by difficulty


Learn C# at your own pace, the exercises are ordered by difficulty.

Make a donation


Your donations support our work and contribute to the maintenance of the app.

Advertising


CookieOwn and third party cookies to improve our services. If you go on surfing, we will consider you accepting its use.