Operators

 using System;

using System.IO;

using System.Linq;

using System.Collections.Generic;


namespace CSharp_Shell

{


 public class Program

 {

  public static void Main()

  {

   /*

   //Check Vowels

   char input;

   Console.Write("Enter a Character : ");

   input = char.Parse(Console.ReadLine());

   //

   if (input == 'A' || input == 'E' || input == 'I' || input == 'O' || input == 'U')

    Console.WriteLine("{0} is a vowel", input);

   else if (input == 'a' || input == 'e' || input == 'i' || input == 'o' || input == 'u')

    Console.WriteLine("{0} is a vowel", input);

   else

    Console.WriteLine("{0} is not a vowel", input);

   */

   /*

   //Calculate (a+b)²

   int a, b, result;

   //

   Console.Write("Enter value of a : ");

   a = int.Parse(Console.ReadLine());

   Console.Write("Enter value of b : ");

   b = int.Parse(Console.ReadLine());

   //

   result = (a * a + b * b + 2 * a * b);

   //

   Console.WriteLine("({0} + {1})² = {2}", a, b, result);

   */

   /*

   //Calculate area of circle

   float radius, area;

   const float Pi = 3.14152f;

   //

   Console.Write("Enter circle radius : ");

   radius = float.Parse(Console.ReadLine());

   //

   area = Pi * radius * radius;

   Console.WriteLine("Area = {0}", area);

   */

   //

   /*

   //Check Even or Odd

   int input;

   //

   Console.Write("Enter a Number : ");

   input = Convert.ToInt32(Console.ReadLine());

   //

   if (input % 2 == 0)

    Console.WriteLine("{0} is even number", input);

   else

    Console.WriteLine("{0} is odd number", input);

   */

   //

   /*

   //Calculate Power of given Number

   int input, power2, power3;

   //

   Console.Write("Enter a number : ");

   input = int.Parse(Console.ReadLine());

   //

   power2 = input * input;

   power3 = input * input * input;

   //

   Console.WriteLine("{0}² = {1}", input, power2);

   Console.WriteLine("{0}³ = {1}", input, power3);

   */

   /*

   //Claculate area of triangle

   float height, Base, area;

   //

   Console.Write("Enter Height : ");

   height = float.Parse(Console.ReadLine());

   Console.Write("Enter Base : ");

   Base = float.Parse(Console.ReadLine());

   //

   area = (height * Base) / 2;

   //

   Console.WriteLine("Area = {0}", area);

   */

  }

 }

}

Comments

Popular Posts