Friday, 6 July 2018

Ankit

C# program to generate voucher code

        C# progran to generate voucher code

code:

using System;


namespace  getvoucher
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Your voucher code is:");
            Random rm = new Random();
            for (int j = 1; j <=16;j++ )
            {
             
                int n = rm.Next(1,9);
                Console.Write(n);
                if (j%4==0)
                {
                    if (j == 16)
                    {
                        Console.Write("");
                    }
                    else
                    Console.Write("-");
                }
            }
            Console.ReadKey();
        }
    }
}

The output will be:

Ankit

About Ankit

Yeppz itz me 18 year old blogger who is sharing about his tricks and tips related to mobile or computer. I am very passionate about Tricks And Hacks, and mainly focust to the tweaks, tricks....

Subscribe to this Blog via Email :