68 229
Assignments Done
99%
Successfully Done
In November 2018

Answer to Question #12113 in C# for Sarah

Question #12113
A program that list the number from 0 to 25, their square, square roots,fourth power, and fourth root. The output should be in a neat five column format.
Expert's answer
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Question12113
{
class Program
{
& static void Main(string[] args)
& {
Console.WriteLine("___________________________________________________________");
Console.WriteLine("|Number | square | square root | fourth power | fourth root|");
Console.WriteLine("|----------------------------------------------------------|");
for (int i = 0; i <= 25; i++)
{
Console.Write("|{0,6:D} |", i);
Console.Write("{0,7:D} |", i * i);
Console.Write("{0,12:G4} |", Math.Sqrt(i));
Console.Write("{0,13:G0} |", Math.Pow(i, 4));
Console.Write("{0,12:G6}|\n", Math.Pow(i, 1.0 / 4.0));
Console.WriteLine("|----------------------------------------------------------|");
}
Console.ReadKey();
& }
}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions