1. Course
  2. Flow controls B
  3. Digits in a number

Digits in a number


Last updated: 8/22/2020 Difficulty: Easy

Create a program in C# to calculate how many digits has a positive integer.

If the user enters a negative integer, the program must show a warning message, and proceed with the equivalent positive number.

Input

112
-5345

Output

2 digits
(Warning: it is a negative number)
4 digits

Solution

Flow controls B

8 / 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