Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Basic_arithmatic

class calculation
{
  double c;
  void add(double a, double b)
  {
    c = a+b;
    print('The Result of Addition operation is: $c');
  }
  void sub(double a, double b)
  {
    c = a-b;
    print('The Result of Subtraction operation is: $c');
  }
  void mul(double a, double b)
  {
    c = a*b;
    print('The Result of Multiplication operation is: $c');
  }
  void div(double a, double b)
  {
    c = a/b;
    print('The Result of Division operation is: $c');
  }
  void rem(double a, double b)
  {
    c = a%b;
    print('The Result of Remainder operation is: $c');
  }
}
main()
{
  calculation c = new calculation();
  c.add(8,3.4);
  c.sub(8,3.4);
  c.mul(8,4);
  c.div(15,2);
  c.rem(29,7);
}

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.