This is a little Program written in C sharp with Mono, It reads a number from the Terminal multiplies with itself and then print back:
using System.IO; using System; class Program { static void Main() { Console.Write("write your number: ");//Info text String str = Console.ReadLine();//read input Console.WriteLine("your number: "+str);//print input int i = Convert.ToInt32(str);//convert to intager i = i*i;//calculate Console.WriteLine("your result: "+i);//print result } }
To compile run this:
mcs *.cs -out:main.exe
And then start with Mono :
mono main.exe
our result looks like this:
write your number: 4 your number: 4 your result: 16
The same Programm in Java is here : Java input output example