Skip to content

DevkarthikSuresh/Arithmetic_Operators

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Arithmetic_Operators

Experiment_3

AIM -

To use operators to add two numbers.

Software Used

VS Code

Theory

Airthmetic operators are symbols used in programming to perform operations on variables and values. They are important to writing expressions and making decisions in code.

Types:

Addition (+): Adds two operands. Example: a + b Subtraction (-): Subtracts the second operand from the first. Example: a - b Multiplication (*): Multiplies two operands. Example: a * b Division (/): Divides the numerator by the denominator. Example: a / b Modulus (%): Returns the remainder of a division operation. Example: a % b

Algorithm

  • Start

  • Declare three integer variables: a, b, and c.

  • Prompt and Read First Number

  • Output: "Enter num 1: ". Read the input value and store it in variable a. Prompt and Read Second Number

  • Output: "Enter num 2: ". Read the input value and store it in variable b. Calculate the Sum

  • Compute the sum of a and b and store the result in variable c. Output the Result

  • Output the result: "The No. is: " followed by the value of c.

  • End

Conclusion

We learnt to use the basic arithmetic operators in C++.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages