Code:using System; using System.Collections.Generic; using System.Text; namespace CMH_ENCRYPT { class Program { static void Main(string[] args) { string Name,Value; //declaration of variable int Output; int Formula; Console.ForegroundColor = ConsoleColor.Green; Console.Write("\n\n\t\t\t\t"+"ENTER NAME:"); //INPUTING VARIABLE Name Name = Console.ReadLine(); Console.Write("\n\n\t\t\t "+"ENTER VALUE (1-10): "); //NUMBER THAT WILL ADD TO 9%10 Value = Console.ReadLine(); Formula =(Convert.ToInt32(Value)+ 9) % 10; //FORMULA IN GETTING THE ENCRYPTION for (int i = 0; i < Name.Length; i++) //WILL TRAVERSE THE ENTIRE CHAR { Convert.ToInt32(Name[i]); //WILL CONVERT NAME TO INT Output = Formula + Name[i]; //ENTERING THE SUM OF FORMULA AND NAME TO LOCAL VARIABLE OUTPUT Console.Write("the encryption is: " + "{0}",Convert.ToChar(Output)); //DISPLAY THE OUTPUT } Console.Read(); } } }
this program is already ok but i want to include spacing .
how to do that. .




Reply With Quote