Csharp For Final
Csharp For Final
using System;
class Program
{
static void Main()
{
Console.Write("Enter the number of elements in the array: ");
int n = int.Parse(Console.ReadLine());
```csharp
using System;
class Program
{
static void Main()
{
Console.WriteLine("Welcome to the Ethiopian Tax Calculator");
double tax = 0;
double remainingSalary = salary;
int i = 0;
return tax;
}
}
```
using System;
class Program
{
static void Main()
{
Console.WriteLine("Welcome to the Ethiopian Tax Calculator");
double tax = 0;
double remainingSalary = salary;
int i = 0;
return tax;
}
}
using System;
class Program
{
static void Main()
{
// Create an array of integers of size 5
int[] array = new int[5];
4. every window service has different start types what are those service
types
B. Automatic: The service starts automatically when the system boots up.
It starts immediately upon system boot without any delay.
5.using C#, Create an object of the car class, with the name myObj. then
we print the value of the fields color and maxSpeed?
using System;
class Car
{
public string color;
public int maxSpeed;
}
class Program
{
static void Main()
{
// Create an object of the Car class with the name myObj
Car myObj = new Car();
using System;
class Program
{
static void Main()
{
Console.Write("Enter the temperature in Celsius: ");
double celsius = double.Parse(Console.ReadLine());
Ans= 1
using System;
class Program
{
static void Main()
{
Console.Write("Enter the number of rows (n): ");
int n = int.Parse(Console.ReadLine());
using System;
class Program
{
static long Factorial(int n)
{
if (n == 0 || n == 1)
{
return 1;
}
else
{
return n * Factorial(n - 1);
}
}
if (number < 0)
{
Console.WriteLine("Factorial is not defined for negative
numbers.");
}
else
{
long result = Factorial(number);
Console.WriteLine($"Factorial of {number} is: {result}");
}
}
}