Holooly Plus Logo

Input / Question:

Input / Question:

Write a program that displays the following output on the screen.

1 2 3 4 5 1 4 9 16 25 1 8 27 64 125

Verified

Output/Answer

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

 

namespace Problem28

{

classProblem28

{

staticvoid Main(string[] args)

{

Console.WriteLine("\t\tName: Ehtesham Mehmood\n\t\tRoll No: 11014119-131\n\t\tSection: AE\n \t\t UOG\n");

int temp1;

int temp2;

for (int i = 1; i <= 5; i++)

{

 

Console.Write(i);

Console.Write(" ");

}

Console.WriteLine("\n");

for (int i = 1; i <= 5; i++)

{

temp1 = i * i;

 

Console.Write(temp1);

Console.Write(" ");

}

Console.WriteLine("\n");

for (int i = 1; i <= 5; i++)

{

temp2 = i * i*i;

 

Console.Write(temp2);

Console.Write(" ");

}

 

Console.ReadKey();

}

}

}

Output: