/** This code snippet was taken from freecodesnippets.com*/
using System;
public class PassArguments {
public static void Main(String[] args) {
double hotC, coldC;
double hotF, coldF;
if (args.Length != 2) {
Console.WriteLine ("Enter a hot and a cold temerature as program arguments.");
return;
}
hotC = double.Parse(args[0]);
hotF = 9.0*hotC/5.0 + 32.0;
Console.WriteLine ("The Fahrenheit temperature is: {0:F1}", hotF);
coldC = double.Parse(args[1]);
coldF = 9.0*coldC/5.0 + 32.0;
Console.WriteLine ("The Fahrenheit temperature is: {0:F1}", coldF);
}
}
No replies to this topic
#1
Posted 10 February 2010 - 09:19 PM
C# Convert Celsius to Fahrenheit
|
|
|
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









