Assignment of C#:-
1) WAP to reverse three-digit number without using Loop
2) WAP to calculate electricity bill where unit price and total consumption will be entered by the user.
3) WAP to create a salary calculator where basic, ta, da, comm,pf, and noofleave will be entered by the users.
2) WAP to calculate electricity bill where unit price and total consumption will be entered by the user.
3) WAP to create a salary calculator where basic, ta, da, comm,pf, and noofleave will be entered by the users.
using System;
class SalaryCalc
{
public static void Main()
{
float basic=12000,ta=200,da=200,comm=300,pf=500,nl=2,asal=200;
float tsal,gsal;
gsal=basic+ta+da+comm;
Console.WriteLine("Gross Salary Is {0}",gsal);
tsal=gsal-(gsal/30)*nl-asal-pf;
Console.WriteLine("Total Salary Is {0}",tsal);
}
}
4) WAP to calculate Area of Circle and Area of Triangle.
using System;
ReplyDeleteclass reverse
{
public static void Main()
{
int a,b,c,d,rev;
Console.WriteLine("enter three digit number");
a=int.Parse(Console.ReadLine());
b=a%10;
c=(a/10)%10;
d=(a/10)/10;
rev=b*100+c*10+d;
Console.WriteLine("result is{0}",+rev);
}
}
static void Main(string[] args)
ReplyDelete{
float a=3, b=6, c=7;
float semipermiter = (a + b + c) / 2;
float area = ((float)Math.Sqrt(semipermiter * (semipermiter-a) * (semipermiter-b) *( semipermiter-c)));
Console.WriteLine("area of triangle is :"+area);
}