Posts

Showing posts from October, 2020

ARRAY IN C#

Image
 //int[] array = new int[5];             //array[0] = 55;             //array[1] = 563;             //array[2] = 56;             //array[3] = 586;             //array[4] = 556;             //Console.WriteLine(array[2]);             //Console.ReadLine();             //string[] array = new string[4];             //array[0]="ashish";             //array[1] = "aman";             //Console.WriteLine(array[1]);             //int[] array = new int[]{1,2,3};             //Console.WriteLine(array[2]);             //string[] array = { "ashish","aman"};        ...

Multiplication of three numbers in C#

  Write a C# Sharp program to print the output of multiplication of three numbers which will be entered by the user Test Data: Input the first number to multiply: 2 Input the second number to multiply: 3 Input the third number to multiply: 6 Expected Output: 2 x 3 x 6 = 36 solution             int a, b, c, total;             Console.WriteLine("Input the first number to multiply");             a =Convert.ToInt32( Console.ReadLine());             Console.WriteLine("Input the second number to multiply");             b = Convert.ToInt32(Console.ReadLine());             Console.WriteLine("Input the third number to multiply");             c = Convert.ToInt32(Console.ReadLine());             total = a * b * c;             C...

Function Question in C# program

Image
Question Write a Program in C# to Create a function for the Sum of two number  Enter a first number : 5 Enter  second number : 5 Expected Output  The Sum of two number is : 10 solution:-   using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication14 {     class Program     {         public static int sum (int a,int b)         {             int Total;              Total= a + b;              return Total;         }         static void Main(string[] args)         {             Console.WriteLine("Enter first Number");             int n1 =Convert.ToInt32( Console.ReadLine());           ...