What's new

C# Ano mali dito

DOPEinDOPAMINE

Forum Guru
Elite
Joined
Jun 6, 2018
Posts
2,200
Solutions
5
Reaction
6,222
Points
1,481
Age
21
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); }
 
Eto idok.
Screenshot_2022_1021_224421.png
 

Attachments

Back
Top