Contoh perulangan dalam c#


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace tugas1
{
    class Program
    {
        static void Main(string[] args)
        {
           
            string kata;
            int i,angka;
            Console.WriteLine("Masukkan sebuah kata :");
            kata = Console.ReadLine();
            Console.WriteLine("masukkan maksimal perulangan : ");
            angka = Convert.ToInt32(Console.ReadLine());
         
           
            for (i = 0; i <= angka; i++)
            {
                Console.WriteLine("{0}", kata);
            }
            Console.ReadLine();
        }
    }
}

0 komentar:

Posting Komentar

 

arpina © 2011 Design by Best Blogger Templates | Sponsored by HD Wallpapers