Monday, March 25, 2013

C# 2012: Print your name five times

Do you love programming in command line, Program written in Visual studio using c# can be debugged in command line without GUI. Here is simple program written in C# which prints your name five times: 


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Class_Activity_Friday_5_DC
{
class Program {
static void Main(string[] args)
{
for (int z = 1; z <= 5; z++)
{
Console.WriteLine("John Doe"); //Write your name
     }

   }
  } 
 }

The program is written using for loop. If you have some experience in programming then you will definitely understand it. Do not forget to comment me if you have any questions.

No comments:

Post a Comment