Search This Blog

This website completely moved to new domain. For latest content, visit www.programmingposts.com

C# PROGRAM TO PRINT SMILEY



C# PROGRAM TO PRINT SMILEY / ASCII VALUE OF 1 :

using System;
 
namespace SmilingFace
{
    class Program
    {
        static void Main(string[] args)
        {
            int a = 1, i;
            for (i = 0; i < 250; i++) //prints love symbol 250 times
                Console.Write((char)a);  
                //Console.Write((char)1);
            Console.ReadKey();
            
        }
    }
}
.....
Output:


Explanation: Here we are just printing the ASCII symbol of 1 which looks like a smiling face. The ASCII symbol of 2 also looks similar to this   check here
c# program for printing love symbol click here


3 comments:

  1. Console.WriteLine((char)1);

    Console.WriteLine((char)2);
    Console.WriteLine((char)3);
    Console.WriteLine((char)4);
    Console.WriteLine((char)5);
    Console.WriteLine((char)6);
    Console.WriteLine((char)7);
    Console.ReadLine();

    Each one is, one of Smilie..

    ReplyDelete