FactFiboCube and Calender
FactFiboCube and Calender
Factorial
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace AWP_Practicals
{
class Program
{
static void Main(string[] args)
{
int i, number, fact;
Console.WriteLine("Enter the Number");
number = int.Parse(Console.ReadLine());
fact = number;
for (i = number - 1; i >= 1; i--)
{
fact = fact * i;
}
Console.WriteLine("\nFactorial of Given Number is: " + fact);
Console.ReadLine();
}
}
}
Money Conversion
using System;
using System.Collections.Generic;
using System.Diagnostics.Metrics;
using System.Linq;
using System.Text;
namespace AWP_Practicals
{
class Program
{
static void Main(string[] args)
{
int choice;
Console.WriteLine(" Enter your Choice:\n 1 - Dollar to Rupee \n 2 - Euro to Rupee \n 3 -
Malaysian Ringgit to Rupee ");
choice = int.Parse(Console.ReadLine());
switch (choice)
{
case 1:
Double dollar, rupee, val;
Console.WriteLine(" Enter the Dollar Amount :");
dollar = Double.Parse(Console.ReadLine());
Console.WriteLine(" Enter the Dollar Value :");
val = double.Parse(Console.ReadLine());
rupee = dollar * val;
Console.WriteLine($"{dollar} Dollar Equals {rupee} Rupees ");
break;
case 2:
Double Euro, rupe, valu;
Console.WriteLine(" Enter the Euro Amount :");
Euro = Double.Parse(Console.ReadLine());
Console.WriteLine(" Enter the Euro Value :");
valu = double.Parse(Console.ReadLine());
rupe = Euro * valu;
Console.WriteLine($"{Euro} Euro Equals {rupe} Rupees ");
break;
case 3:
Double ringit, rup, value;
Console.WriteLine(" Enter the Ringgit Amount :");
ringit = Double.Parse(Console.ReadLine());
Console.WriteLine(" Enter the Ringgit Value :");
value = double.Parse(Console.ReadLine());
rup = ringit * value;
Console.WriteLine($"{ringit} Malaysian Ringgit Equals {rup} Rupees ");
break;
}
Console.ReadLine();
}
}
}
Cube
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace C_Tutorial
{
internal class Class1
{
public double cube;
class MainClass
{
public static void Main(string[] args)
{
Class1 class1 = new Class1();
class1.Cube = 5.10;
Console.WriteLine("Cube : "+ class1.cube);
Console.ReadKey();
}
}
}
Fibonacci series
using System;
namespace AWP_P1_A
{
internal class Program
{
static void Main(string[] args)
{
// Fibonacci Series
Code:
C# Code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebApplication1
{
public partial class Register : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Aspx Code:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:Calendar ID="Calendar1" runat="server" BackColor="#FFFFCC"
BorderColor="#FFCC66" BorderWidth="1px" DayNameFormat="Shortest" Font-
Names="Verdana" Font-Size="8pt" ForeColor="#663399" Height="200px"
NextPrevFormat="ShortMonth" OnDayRender="Calendar1_DayRender"
ShowGridLines="True" Width="300px"
OnSelectionChanged="Calendar1_SelectionChanged" >
<DayHeaderStyle BackColor="#FFCC66" Font-Bold="True" Height="1px" />
<NextPrevStyle BorderStyle="Solid" BorderWidth="2px" Font-Size="9pt"
ForeColor="#FFFFCC" />
<OtherMonthDayStyle BackColor="#FFCC99" BorderStyle="Solid"
ForeColor="#CC9966" />
<SelectedDayStyle BackColor="Red" Font-Bold="True" />
<SelectorStyle BackColor="#FFCC66" />
<TitleStyle BackColor="#990000" Font-Bold="True" Font-Size="9pt"
ForeColor="#FFFFCC" />
<TodayDayStyle BackColor="#FFCC66" ForeColor="White" />
<WeekendDayStyle Height="50px" />
</asp:Calendar>
<br />
<br />
<asp:Label ID="Label1" runat="server"></asp:Label>
<br />
<asp:Label ID="Label2" runat="server"></asp:Label>
<br />
<asp:Label ID="Label3" runat="server"></asp:Label>
<br />
<asp:Label ID="Label4" runat="server"></asp:Label>
<br />
<asp:Label ID="Label5" runat="server"></asp:Label>
<br />
<br />
<asp:Button ID="Button1" runat="server" OnClick="btnResult_Click" Text="Result" -
<br />
<asp:Button ID="Button2" runat="server" OnClick="btnReset_Click" Text="Reset" />
</form>
</body>
</html>