Pages

Wednesday, May 22, 2013

write a program to check the number single digits only

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        A a = new A();
        int r = a.Add(3, 8);
        if (r <= 9)
            Response.Write(r);
        else
        {
            Response.Write("its not a single digit");
        }
    }
}
public class A
{
    public int Add(int fn, int sn)
    {
        return fn + sn;
    }
}

No comments:

Post a Comment