Advertisement
damesova

Solution-FormattingExerciseBadFormattingToBeFixed

Mar 19th, 2023
681
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.45 KB | Source Code | 0 0
  1. using System;
  2.  
  3. class Program
  4. {
  5.     static void Main()
  6.     {
  7.         Console.WriteLine("Enter your name:");
  8.         string name = Console.ReadLine();
  9.  
  10.         if (name == "Alice")
  11.         {
  12.             Console.WriteLine("Hello Alice!");
  13.         }
  14.         else if (name == "Bob")
  15.         {
  16.             Console.WriteLine("Hello Bob!");
  17.         }
  18.         else
  19.         {
  20.             Console.WriteLine("Hello stranger!");
  21.         }
  22.     }
  23. }
  24.  
Tags: formatting
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement