BufferedReader tKeyboard = new BufferedReader(new InputStreamReader(System.in)); String tAgeString = tKeyboard.readLine(); int tAge = Integer.parseInt(tAgeString);
string tAgeString = Console.ReadLine(); int tAge = int.Parse(tAgeString);
Here is a program that reads in a temperature given in degrees Centigrade and outputs the corresponding value in degrees Fahrenheit:
using System;
namespace ConsoleConvert
{
class Class1
{
[STAThread]
static void Main()
{
Console.Write("Centigrade value: ");
string tCentigradeString = Console.ReadLine();
double tCentigrade = double.Parse(tCentigradeString);
double tFahrenheit = 32 + tCentigrade*9/5;
Console.WriteLine("Fahrenheit value: " + tFahrenheit);
}
}
}