//This program displays a conversion table of inches to
meters and prints a blank line after each 12 count.
using System;
class InchtoMeterTable
{
static void Main()
{
double
inches, meters;
int
counter;
counter = 0;
for
(inches = 1.0; inches <= 144.0; inches++)
{
//convert
to meters
meters = inches / 39.37;
Console.WriteLine(inches
+ " inches is " + meters + " meters.");
counter++;
//Every
12th line, print a blank line.
if
(counter == 12)
{
Console.WriteLine();
counter = 0; //reset the line counter
}
}
}
}
No comments:
Post a Comment