Maha

Maha

  • NA
  • 0
  • 327.8k

Code to hide

Dec 24 2011 10:35 AM
Console window of this program shows following output:

Enter 3 price values
10
$10.00
20
$20.00
30
$30.00

I wish to know whether is there any code to hide entered value and only showing its $ value (for example to hide 10, 20 and 30)

using System;

namespace _6e9
{
class Program
{
static void Main(string[] args)
{
double p;
int x;

double[] price = new double[3];

Console.WriteLine("Enter 3 price values");

for (x = 0; x < price.Length; ++x)
{
price[x] = new double();
p = Convert.ToDouble(Console.ReadLine());
Console.WriteLine(p.ToString("C"));

}
Console.ReadKey();
}
}
}



Answers (4)