TestingDocs.com
    Software Testing website
    • Automation
      • Selenium
      • JBehave Framework
    • Tutorials
      • MySQL Tutorials
      • Testlink
      • Maven
      • Git
    • IDEs
      • IntelliJ IDEA
      • Eclipse
    • Flowcharts
      • Flowgorithm
      • Raptor
    • About

    Dart

    Dart Arithmetic Operators

    Overview

    Arithmetic Operators are used to perform arithmetic operations on operands. Most of the Dart arithmetic operators are binary operators, which means they operate on two operands.

    Dart operators:

    https://www.testingdocs.com/dart-operators/

    Dart Arithmetic Operators

    The following table describes the symbols, names, and descriptions of the Dart arithmetic operators:

     

    Operator Symbol Operation Name  Description
                 + Addition Adds two operands
                 – Subtraction Subtracts two operands
                 * Multiplication Multiplies two operands
                 / Division Divides two operands
                 % Modulus Returns the remainder of the division of two operands
                 -/ Integer Division Divides two operands and returns the result as an integer
                 –expr Unary Minus Reverses the sign of the expression

     

    Demo Program

    /*
    * Arithmetic Operators Dart Program
    * Dart Tutorials - www.TestingDocs.com
    */
    void main()
    {
    // Declare two variables
    int a=7;
    int b=9;
    
    //Add a and b
    var sum= a+b;
    print ("The sum of a and b is = $sum");
    
    // Subtract a and b
    var diff= a-b;
    print("The difference between a and b is = $diff");
    
    //Multiplication of a and b
    var product= a*b;
    print("The product of a and b is = $product");
    
    // Division of a and b
    var quot=b/a;
    print("The quotient of a and b is = $quot");
    
    //Remainder of a and b
    var rem=b%a;
    print("The remainder of a and b is = $rem");
    }

    Dart Arithmetic Operators IDE

    Program Output

    C:/tools/dart-sdk/bin/dart.exe –enable-asserts C:\Users\testingdocs\SampleDartProject\arithmetic.dart
    The sum of a and b is = 16
    The difference between a and b is = -2
    The product of a and b is = 63
    The quotient of a and b is = 1.2857142857142858
    The remainder of a and b is = 2

     

    Dart Arithmetic Operators Program Output

    —

    More information on Dart Programming language:

    https://dart.dev/

    Related Posts

    Dart Compilation Techniques

    Dart /

    Dart Compilation Techniques

    Dart String Interpolation

    Dart /

    Dart String Interpolation

    Dart Lists

    Dart /

    Dart Lists

    Dart /

    Dart String Methods

    Dart Print Expression

    Dart /

    Dart print() function

    ‹ Dart Operators› Dart Relational Operators

    Recent Posts

    • ChatGPT Subscription Plans
    • Stellar Converter for Database
    • Stellar Log Analyzer for MySQL
    • Stellar Repair for MySQL
    • ChatGPT Capabilities
    • How to secure your SQL Database: Tips and Tricks
    • ChatGPT4 Conversational AI Features
    • Shaping the Future of Development: Exploring Key Trends in Software Engineering
    • Improving Java Performance with Multithreading
    • Open-source Vector Databases

    Back to Top

    Links

    • Contact
    • Privacy Policy
    • Cookie Policy

    www.TestingDocs.com