[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


c#  Condtion to only accept Multiples of 20's....

Posted on 2011-04-25
Medium Priority
Last Modified: 2012-05-11
i want to put a condition that  the user can only withdrawal multiples of 20's.  how would i do this?

i tried something like    if(  input    !=  input %20)  but that only letting accept 2 . . so it only letting type the remainder 20.     if i put it == , it just ignores all completely, b/c i put 35 and it goes thru still.
Question by:Ajs135
LVL 39

Accepted Solution

Pratima Pharande earned 2000 total points
ID: 35458336
if ( input %20 == 0)
                  Response.Write("True : accept");
Response.Write("False : reject");

LVL 10

Expert Comment

ID: 35458404
pratima@ is right actually input %20 this means divide input on 20 and if it will divide completely means no remainder then you have multiple of 20 so

if(input %20 == 0) will work fine


Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question