40 lines
1001 B
C#
40 lines
1001 B
C#
static int ass1()
|
|
{
|
|
const int spacing = 10;
|
|
|
|
String a = "a";
|
|
String b = "b";
|
|
String c = "c";
|
|
|
|
Console.WriteLine(a + b + c + "hejsan" + "trololol");
|
|
|
|
Console.WriteLine("my textt {0} {1}", a, b);
|
|
Console.WriteLine("my textt {0} {1}", b, a);
|
|
Console.WriteLine($"my text {a} {b}");
|
|
Console.WriteLine($"my text " + a + " " + b);
|
|
|
|
Console.WriteLine($"{"Number",-spacing}" +
|
|
$"{"Square",-spacing}" +
|
|
$"{"Cube",-spacing}");
|
|
|
|
for (int i = 1; i <= 10; i++)
|
|
{
|
|
double square = Math.Pow(i, 2);
|
|
|
|
Console.WriteLine($"{i,-spacing}" +
|
|
$"{square,-spacing}" + // square
|
|
$"{Math.Pow(i, 3),-spacing /* cube */}"); // cube
|
|
|
|
//Console.WriteLine($"{i,-spacing}{Math.Pow(i, 2),-spacing}{Math.Pow(i, 3),-spacing}");
|
|
}
|
|
|
|
//int i = 1;
|
|
//while (i <= 10)
|
|
//{
|
|
|
|
//}
|
|
return 1;
|
|
}
|
|
|
|
Console.WriteLine("Assignment 1");
|
|
var returnValue = ass1(); |