1. Course
  2. Flow controls B
  3. Access control

Access control


Last updated: 8/22/2020 Difficulty: Intermediate

Write an access control in C# that asks the user for the username and password. Both must be integers and repeat until the login is 12 and the password is 1234 or up to a maximum of 3 attempts.

If the username and password are correct it shows Login successful, but Login failed.

Input

1234
1234
admin
admin
admin
1234

Output

Login failed
Login failed
Login failed

Solution

Flow controls B

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