Skip to main content
added 10 characters in body
Source Link
Anthony
  • 131
  • 3

C#: 147147 136 Characters

It won't beat most other languages, but here's a C# solution for fun:

var r=new Random().Next(1,100);var d=true;whileg=0;while(dg!=r){var g=int.Parse(Console.ReadLine());Console.WriteLine(""+g+'\n'+(g<r?'+':g>r?'-':'='));d=g!=r;;}

C#: 147 Characters

It won't beat most other languages, but here's a C# solution for fun:

var r=new Random().Next(1,100);var d=true;while(d){var g=int.Parse(Console.ReadLine());Console.WriteLine(""+g+'\n'+(g<r?'+':g>r?'-':'='));d=g!=r;}

C#: 147 136 Characters

It won't beat most other languages, but here's a C# solution for fun:

var r=new Random().Next(1,100);var g=0;while(g!=r){g=int.Parse(Console.ReadLine());Console.WriteLine(""+g+'\n'+(g<r?'+':g>r?'-':'='));}
Source Link
Anthony
  • 131
  • 3

C#: 147 Characters

It won't beat most other languages, but here's a C# solution for fun:

var r=new Random().Next(1,100);var d=true;while(d){var g=int.Parse(Console.ReadLine());Console.WriteLine(""+g+'\n'+(g<r?'+':g>r?'-':'='));d=g!=r;}