MOD function

Reply Forum
Forum postDavidY @ 2008-11-30 00:42:42
ReplyReply to
hi i have another question how do i use it so that i can get these calculations to show up correctly

int change = 92;
int NoQ = 25;
int NoD = 10;
int NoN = 5;
int NoP = 1;

Console.Write("quarters: " );
Console.WriteLine(change/NoQ);
Console.Write("dimes: " );
Console.WriteLine();
Console.Write("nickles: " );
Console.WriteLine();
Console.Write("pennies: " );
Console.WriteLine();

this is what i have so far


Forum postWebmaster @ 2008-12-01 14:32:51
ReplyReply to
The MOD operator in C# is a percent sign, like this: %











© net-tutorials.com 2006 - 2012

MailContact net-tutorials.com