Warning: session_start() [function.session-start]: open(/tmp/sess_lj82n6f6d5k7kr40pg44217m95, O_RDWR) failed: Disk quota exceeded (122) in /home/vipozico/forum.tutorials7.com/qa-include/qa-app-users.php on line 143
Sequence of 10 numbers - each number multiplied by itself in C#
settingsAccountsettings
By using our mini forum, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy
Menusettings

Q: Sequence of 10 numbers - each number multiplied by itself in C#

+4 votes

I need to write a Console Application in C# of a sequence of 10 numbers - from 0 to 9 - and on each line to print - the number multiplied by itself.

A bit foggy explanation, but the output must look like this:

C# numbers multiply

asked in C# category by user Jolie Ann
edited by user golearnweb

1 Answer

+2 votes
 
Best answer

Try to use this code:

using System;

class MultiplyNumbers
{
    static void Main()
    {
        for (int i = 0; i < 10; i++)
        {
            Console.WriteLine(i + " --> " + i * i);
        }
    }
}
answered by user paulcabalit
edited by user golearnweb
Works! Thanks!
...