Skip to main content

Posts

Rail Fence Technique Cryptography program in c sharp #

using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication6 {     class Program     {         public static string s = "",s2="";         public static int i = 0;         static void Main(string[] args)         {             int ch = 1;             while (ch == 1 || ch == 2)             {                 Console.WriteLine("Enter 1 for cipher "+"\n"+"Enter 2 for decipher ");                 ch = Convert.ToInt32(Console.ReadLine());                 if (ch == 1)                     cipher();                 else   ...

Encoding a string in c sharp #

using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication4 {     class Program     {         static void Main(string[] args)         {             Console.WriteLine("Enter a string");             string s = Console.ReadLine(),s2="",s3="",s4="";             string[] arr={"0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"};             string fstring = "", dstring = "",hstring="";                                             int i,ch;                       for (i = 0; i < s.Length; i++)                     ...

Palindrome within palindrome in c sharp #

using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication6 {     class Program     {         static void Main(string[] args)         {             string s = Console.ReadLine();             int i, j;             string s2 = "",s3="";                     for (i = 0; i < s.Length; i++)             {                 s2 = "";                 s2 = s[i].ToString();                 for (j = i + 1; j < s.Length; j++)                 {                     s2 += s[j];   ...

Lcm of array elemts in c# sharp

using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication3 {     class Program     {         static void Main(string[] args)         {            int n,i,j,max=0,lcm=1,c=0,k=0;             Console.WriteLine("Enter array size");             n=Convert.ToInt32(Console.ReadLine());             int[] arr = new int[n];            Console.WriteLine("Enter array elemrnts");            for (i = 0; i < n; i++)                arr[i] = Convert.ToInt32(Console.ReadLine());            Array.Sort(arr);            max = arr[n - 1];                ...

Simple brute force in c#

using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Brute_force {     class Program     {         static void Main(string[] args)         {             String s;             int i, j = 1, c = 1, asc;             Console.WriteLine("ENTER A STRING");                 s=Console.ReadLine();                 s = s.ToUpper();                 Console.WriteLine("brute force attacking ");             for(j=1;j<26;j++)             {                 for (i = 0; i < s.Length; i++)                 {         ...

I support israel

Image credits to :  http://www.judaicaheaven.com/Detail.bok?no=336

String operations in c sharp # using Microsoft visual studio 2010

using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication3 {     class Program     {         static void Main(string[] args)         {             string s,find;             int l,i=0;             s = Console.ReadLine();             string.Concat(s);             l=s.Length;             Console.WriteLine(s);             Console.WriteLine("length\t"+l );                         Console.WriteLine("first and last character  " + s[0]+"  "+s[l-1] );             for (i = 0; i < l; i++)             {      ...