SHARE
TWEET

Untitled

knikolov98 Sep 17th, 2019 84 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top