Run Code  | API  | Code Wall  | Misc  | Feedback  | Login  | Theme  | Privacy  | Patreon 

p1

using system;
class calculator
{
    float a,b;
char operator;
void getdata()
{
a=Convert.ToFloat(Console.Readline());
b=Convert.ToFloat(Console.Readline());
operator=Convert.ToChar(Console.Readline());
}
}
void calc()
{
    if(operator=='+')
    {
        Console.WriteLine("The sum of two number is"+a+b);
    }
    else
        if(operator=='-')
    {
        Console.Writeline("The difference of two number is"+a-b);
    }
    else
        if(operator=='*')
    {
        console.wrieline("The product of two number is"+a*b);
    }
    else
        if(operator=='/')
    {
        console.writeline("The quatient of two number is"+a/b);
    }
}
class program
{
    static void Main()
{
    calculator C=new calculator();
    C.getdata();
    C.calc();
}
}

    
    
    
    
    
    
    
 run  | edit  | history  | help 0