Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ExercisesProject.Exercises
- {
- class Password
- {
- public static void Main()
- {
- int user, pass;
- int counter = 0;
- do
- {
- Console.Write("Enter a user :");
- user = Convert.ToInt32(Console.ReadLine());
- Console.Write("Enter a password :");
- pass = Convert.ToInt32(Console.ReadLine());
- if ((user != 12 || (pass != 1234)))
- {
- Console.Write("Login Error");
- counter++;
- }
- }
- while ((user != 12 || (pass != 1234)) && (counter != 3));
- if ((user != 12 || (pass != 1234)))
- Console.WriteLine("Logged Out");
- else
- Console.WriteLine("Login successful");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement