2.19 - Several mutiplication tables, do-while

Objetive

Display the multiplication tables from 2 to 6, using nested "do...while" statements.

Solution

using System;
public class SeveraltimesTable
{
    public static void Main()
    {
        int num, multiplier;
 
        num = 2;
            
        do
        {
        
            multiplier = 1;
            do
            {
                Console.WriteLine("{0} x {1} = {2}", 
                    num, multiplier, num*multiplier);
                multiplier++;
            }
            while (multiplier <= 10);
         
            Console.WriteLine();
            num++;
            
        } while (num <= 6);
    }   
 }

Popular Posts