Posted by: DeltaGamma April 27, 2010
Login in to Rate this Post:
0
?
Hi Red, here is solution add some more codes.
using
System;public
class Exercise{
// first
static int first(int a, int b)
{
return a - b ;
}
// second
static double second(double x, double y)
{
return x - y;
}
static int Main()
{
int a, b;
double x, y;
Console.WriteLine("Enter int, int only");
Console.Write("a: ");
a =
int.Parse(Console.ReadLine());Console.Write("b: ");
b =
int.Parse(Console.ReadLine());Console.WriteLine("\nint result " +
"regard : ");
Console.WriteLine("Int = {0}mm", first(a, b));
Console.WriteLine();
Console.WriteLine("Enter double, double only");
Console.Write("x: ");
x =
double.Parse(Console.ReadLine());Console.Write("y: ");
y =
double.Parse(Console.ReadLine());Console.WriteLine("\ndouble result " +
"regard : ");
Console.WriteLine("double = {0}mm",
second(x, y));
Console.WriteLine();
return 0;
}
}
Delta