Advertisement
knikolov98

Untitled

Sep 17th, 2019
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.67 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Nested_conditional_statements
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             double age = double.Parse(Console.ReadLine());
  10.             string gender = Console.ReadLine();
  11.  
  12.             if (gender == "m")
  13.             {
  14.                 if (age >= 16)
  15.                     Console.WriteLine("Mr.");
  16.                 else
  17.                     Console.WriteLine("Master");
  18.             }
  19.             else
  20.             {
  21.                 if (age >= 16)
  22.                     Console.WriteLine("Ms.");
  23.                 else
  24.                     Console.WriteLine("Miss");
  25.             }
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement