Uploaded by Vibitha SureshKumar

codings 10.02.2023

advertisement
using System;
class HelloWorld {
static void Main() {
Console.WriteLine("Hello World");
int number;
Console.WriteLine("Please Enter a number");
number=Convert.ToInt32(Console.ReadLine());
if(number%5==0)
{
Console.WriteLine("Hey it is divisible by five");
}
else
{
Console.WriteLine("Hey it is not divisible by five");
}
}
}
using System;
class HelloWorld {
static void Main() {
Console.WriteLine("Hello World");
Console.WriteLine("Enter a character a or b or c:");
char x;
x=Convert.ToChar(Console.ReadLine());
if(x=='a')
{
Console.WriteLine("Apple");
}
else if(x=='b')
{
Console.WriteLine("Baby");
}
else if(x=='c')
{
Console.WriteLine("Candy");
}
else
{
Console.WriteLine("Sorry I don't know that letter!!");
}
}
}
using System;
class HelloWorld {
static void Main() {
Console.WriteLine("Hello World");
const double PI=3.14;
double radius;
Console.WriteLine("Enter the radius:");
radius =Convert.ToDouble(Console.ReadLine());
double area=radius*radius*PI;
Console.WriteLine("The area of the circle is "+area);
}
}
using System;
class HelloWorld {
static void Main() {
Console.WriteLine("Hello World");
for(int i=0; i<10;i++)
{
Console.WriteLine("How do you open a banana? With a mon-key.");
}
}
}
Download