C++ Basics

Arithmetic Operators In C++

In C++ language we have the usual arithmetic operators for addition, subtraction, multiplication and division. C++ also provides a special arithmetic operator which is called modulus. All these operators are binary operators which means they operate on two operands. So we need two values for addition, subtraction, multiplication, division and modulus.

Posted in: C++ Basics

Program Example # 01 For Arithmetic Operators in C++

Problem statement: Calculate the average age of a class of ten students. Prompt the user to enter the age of each student.

Posted in: C++ Basics

Examples of Expressions in C++

We have already seen the precedence of arithmetic operators. We have expressions for different calculations in algebraic form, and in our programs we write them in the form of C++ statements. Let’s discuss some more examples to get a better understanding.

Posted in: C++ Basics

Program Example # 02 For Arithmetic Operators in C++

Problem Statement: Write a program that takes a four digits integer from user and shows the digits on the screen separately i.e. if user enters 7531, it displays 7,5,3,1 separately.

Posted in: C++ Basics

Program Example # 03 For Arithmetic Operators in C++

Problem Statement: Write a program that takes radius of a circle from the user and calculates the diameter, circumference and area of the circle and display the result.

Posted in: C++ Basics

Compound Assignment (+=, -=, *=, /=, %=, >>=, <<=, &=, ^=, |=) Operators in C++

When we want to modify the value of a variable by performing an operation on the value currently stored in that variable we can use compound assignment operators.

Posted in: C++ Basics

Increase and decrease Operators in C++

The increase operator (++) and the decrease operator (–) increase or reduce by one the value stored in a variable. They are equivalent to +=1 and to -=1, respectively.

Posted in: C++ Basics

Relational and Equality Operators ( ==, !=, >, <, >=, <= ) in C++

In order to evaluate a comparison between two expressions we can use the relational and equality operators. The result of a relational operation is a Boolean value that can only be true or false, according to its Boolean result. We may want to compare two expressions, for example, to know if they are equal or if […]

Posted in: C++ Basics
Have a natural attraction for women cosmetics and replica watches uk clothes, no
more than two for men the most attractive one, is to make their own driving experience, happy and can serve as the facade of the car, another is to highlight the taste edify sentiment rolex replica watch. The replica rolex is undoubtedly the most fashionable accessories, wear a suit to attend the activities, but also get a decent match on the replica watches .