Write a C# Sharp program to display the cube of an integer up to given number.

 


using System;

public class Program
{
    public static void Main()
    {
        int number, cube;

        Console.WriteLine("Enter a number: ");
        number = Convert.ToInt32(Console.ReadLine());

        for (int i = 1; i <= number; i++)
        {
            cube = i * i * i;
            Console.WriteLine("The cube of {0} is {1}", i, cube);
        }
    }
}
Write a C# Sharp program to display the cube of an integer up to given number. Write a C# Sharp program to display the cube of an integer up to given number. Reviewed by Bhaumik Patel on 12:00 AM Rating: 5