Skip to main content

Posts

Showing posts from August 12, 2014

Playfair Cipher in C Sharp #

using System; using System.Collections.Generic; using System.Linq; using System.Text; //WHile making this program we assume that there is no j in the english alphabet // while searching we consider both i and j as same namespace ConsoleApplication5 {     class Program     {         static int rs=0, cs = 0;         static string encrypt="";         static char[,] arr = new char[5, 5];         static void Main(string[] args)         {                         string key="",text="",text2="";             int i,l,r=0,c=-1;                     Console.WriteLine("Enter a key");             key=Console.ReadLine();             key = key.Trim();             key = key.ToUpper();             l=key.Length;                         for (i = 0; i < l; i++)             {                 if ((key[i] == 'J'&& (key.IndexOf('I')>=0))||(key[i]==' '))                 {                 }    

Abstract Class in C Sharp #

using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication10 {      public abstract class abc     {         int i;       public  abc(int y)         {             i = y;             display(i);         }       public abstract void display(int x);           }     class Program:abc     {         public Program():base(1000)         {         }         static void Main(string[] args)         {            Program ab= new Program();             Console.ReadKey();         }         public override  void display(int x)         {             Console.WriteLine("hello we are in Caller Clss"+ x);         }           } }

Interface in c sharp #

using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication11 {     interface abc {      void display();     }     class Program:abc     {         static void Main(string[] args)         {             Program ab = new Program();             ab.display();             Console.ReadKey();         }       public void display()         {             Console.WriteLine("Hello world");         }     } }