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
I love what you guys are usually up too. This sort of clever work and exposure!
Keep up the fantastic works guys I’ve added you guys to my own blogroll.
Appreciate this post. Will try it out.
Very energetic post, I loved that bit. Will there be a part 2?
Peculiar article, just what I wanted to find.