using System;
private static void Main()
{
int x;
int y;
Console.Write("Enter input: ");
string tempVar = ConsoleInput.ScanfRead();
if (tempVar != null)
{
x = int.Parse(tempVar);
}
y = x / 1000;
Console.Write("\nNo. of P1000 bill: {0:D}",y);
x = x % 1000;
y = x / 500;
Console.Write("\nNo. of P500 bill: {0:D}",y);
x = (x % 500);
y = x / 200;
Console.Write("\nNo. of P200 bill: {0:D}",y);
x = (x % 200);
y = x / 100;
Console.Write("\nNo. of P100 bill: {0:D}",y);
x = (x % 100);
y = x / 50;
Console.Write("\nNo. of P50 bill: {0:D}",y);
x = (x % 50);
y = x / 20;
Console.Write("\nNo. of P20 bill: {0:D}",y);
x = (x % 20);
y = x / 10;
Console.Write("\nNo. of P10 coin: {0:D}",y);
x = (x % 10);
y = x / 5;
Console.Write("\nNo. of P5 coin: {0:D}",y);
x = (x % 5);
y = x / 1;
Console.Write("\nNo. of P1 coin: {0:D}",y);
x = (x % 1);
Console.ReadKey(true);
}