0% found this document useful (0 votes)
5 views2 pages

C# 1

Uploaded by

rupams2024
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

C# 1

Uploaded by

rupams2024
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

<Query Kind="Statements">

<RuntimeVersion>8.0</RuntimeVersion>
</Query>

//int x=12*30;
//Console.WriteLine(x);
//===========================================*\

/*--using System;
Console.WriteLine(FeetToInches(30));
Console.WriteLine(FeetToInches(100));

int FeetToInches(int feet)


{
int inches = feet * 12;
return inches;
}=============================================*/
//using System;
//SayHello();
//void SayHello()
//{
//string a1="Rupa";
//string a2="Devi";
//Console.WriteLine($"Hello {a1},{a2}");
//}=========================================

//string message="Hello World";


//string upperMessage= message.ToUpper();
//Console.WriteLine(upperMessage);
//int x=2022;
//message = message + x.ToString();
//Console.WriteLine(message);

//bool simpleVar=false;
//if(simpleVar)
// Console.WriteLine("This will not print");
//int x=5000;
//bool lessThanAMile=x<5280;
//if(lessThanAMile)
// Console.WriteLine("This will print");

UnitConverter feetToInches= new UnitConverter(12);


UnitConverter milesToFeet= new UnitConverter(5280);
Console.WriteLine(feetToInches.Convert(30));
Console.WriteLine(milesToFeet.Convert(100));
Console.WriteLine(feetToInches.Convert(milesToFeet.Convert(1)));
public class UnitConverter
{
int ratio;

public UnitConverter(int unitRatio)


{
ratio = unitRatio;
}
public int Convert(int unit)
{
return ratio*unit;
}
}
/*int a = int.Parse(Util.ReadLine());
int b = int.Parse(Util.ReadLine());
int c = int.Parse(Util.ReadLine());
int big = a > b ?(a > c ? a : c) : (b > c ? b : c);
Console.WriteLine($"The largets of {a},{b},{c} is {big}");*/

/*int a = int.Parse(Util.ReadLine());
int b = int.Parse(Util.ReadLine());
int c = int.Parse(Util.ReadLine());
if(a > b && a > c)
{
Console.WriteLine($"The largest of {a},{b},{c} is {a}");
}
else if(b > c && b > a)
{
Console.WriteLine($"The largest of {a},{b},{c} is {b}");
}
else
{
Console.WriteLine($"The largest of {a},{b},{c} is {c}");
}*/
public class Test
{
static int TestValue(int value)
{
if(value ==0)
{
return -1;
}
else if(value <=10)
{
return 0;
}
else if(value <=100)
{
return 1;
}
else
{
return 2;
}
}
static void Main()
{
int result = TestValue(0);
int result1 = TestValue(-1);
int result2 = TestValue(50);

Console.WriteLine(result);
Console.WriteLine(result1);
Console.WriteLine(result2);
}
}

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy