Professional Documents
Culture Documents
CODE:-
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Practical_2a
case 1:
factorial = factorial * i;
Console.WriteLine(factorial);
Console.ReadLine();
break;
case 2:
switch(option_1)
{
case 1:
Console.WriteLine(rupees);
Console.ReadLine();
break;
case 2:
Console.WriteLine(rupees_1);
Console.ReadLine();
break;
}
break;
case 3:
Console.WriteLine("Value of a: ");
int a = int.Parse(Console.ReadLine());
Console.WriteLine("Value of b: ");
int b = int.Parse(Console.ReadLine());
Console.WriteLine("Value of c: ");
int c = int.Parse(Console.ReadLine());
double d = b * b - (4 * a * c);
if (d >= 0)
else
Console.ReadLine();
break;
case 4:
switch (option_2)
case 1:
Console.WriteLine(far);
Console.ReadLine();
break;
case 2:
Console.WriteLine(kel);
Console.ReadLine();
break;
Console.ReadLine() ;
break;
}
Output:-
i. Finding factorial Value
PRACTICAL 2A
Create simple application to perform following operations
CODE:-
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Practical_2a
{
Console.WriteLine("Enter option for : \n 1. Factorial \n 2. Money Conversion \n 3.
Quadratic Equation \n 4. Temperature Conversion");
switch (option)
case 1:
factorial = factorial * i;
Console.WriteLine(factorial);
Console.ReadLine();
break;
case 2:
case 1:
Console.WriteLine(rupees);
Console.ReadLine();
break;
case 2:
Console.WriteLine(rupees_1);
Console.ReadLine();
break;
break;
case 3:
Console.WriteLine("Value of a: ");
int a = int.Parse(Console.ReadLine());
Console.WriteLine("Value of b: ");
int b = int.Parse(Console.ReadLine());
Console.WriteLine("Value of c: ");
int c = int.Parse(Console.ReadLine());
double d = b * b - (4 * a * c);
if (d >= 0)
else
}
Console.ReadLine();
break;
case 4:
switch (option_2)
case 1:
Console.WriteLine(far);
Console.ReadLine();
break;
case 2:
Console.WriteLine("Enter Degree: ");
Console.WriteLine(kel);
Console.ReadLine();
break;
Console.ReadLine() ;
break;
}
Output:-
i. Finding factorial Value
A) USD TO INR
B) EUR TO INR
A)IMAGINARY ROOTS
B) REAL ROOT
A) DEGREE TO FAR
B) DEGREE TO KEN
ii. Money Conversion
A) USD TO INR
B) EUR TO INR
iii. Quadratic Equation
A)IMAGINARY ROOTS
B) REAL ROOT
C)EQUAL AND REAL ROOT
B) DEGREE TO KEN