iTech College - Internet Technology, Online Education, E-Learning, Technician Training, Tech Tutorials, Distance Education, Virtual Learning C++ Course: Operators - www.itechcollege.com C++ Course: Operators - www.itechcollege.com
Free Courses
HTML
JavaScript
CSS
ASP
PHP
JSP
C++
ASP.NET
SQL
AJAX
FTP
XML

courses > C++ > Operators

Operators

Assignment operator

=

This operator assigns a value to a variable. For example:

c = 12;

Arithmetic operators:

+	addition 
-	subtraction 
*	multiplication 
/	division 
%	modulo 

For examples:

a = 2 + 3;
b = 9 - 2;
c = 4 * 5;
d = 6 / 4;
e = 2 % 3;

Relational and equality operators:

==	Equal to 
!=	Not equal to 
>	Greater than 
<	Less than 
>=	Greater than or equal to 
<=	Less than or equal to 

Let's see some examples:

a == b 	// a equal to b
5 > 4 		// 6 is greater than 3
b != c 	// b no equal to c
e >= f 	// e equal to or grater than f
3 < 5 		// 3 is less than 5

Logical operators:

!		No
&&	And
||		Or

For examples:

!(a==b)		//not "a equal to b"
(a==b) && (b==c)//"a equal to b" AND "b equal to c"
(a==b) || (c==b)//"a equal to b" OR "c equal to b"

Conditional operator

?

The syntax of using Conditional operator is:

condition ? result1 : result2

If condition is true, it will return result1, if it is not, it will return result2. For example:

9>7 ? a : b

It will return "a" because the condition "9>7" is true.



  Back to Index Page
 Next Page:  

Include a File and Main Function
Output and Input Data
Variables
Arrays
Operators
The If Statement and The Switch Statement
Loops
Function
Read and Write a Text File
Using Database MySQL
Drawing and Graphics


Online Education, Online Training for Your Job, Distance Education, E-learning Programs for Your Career!Online Colleges, Online Universities, E-learning & Distance Education for Your Career! Easy Job Training & Online Courses.


   Email A Friend  
 
Earn Online Degree
for Your Job
I found a job after I earned an online degree!
Online classes for finding a Job. Online College, Online University, Degrees, E-learning school, online certificate Earn your
online degree now!
Online Training
for Good Job
Why I work so hard but earn so little? Why I cannot find a high paying job?
Online training for a Good Jobs. Online Degree, E-learning school, online certificate Go to
online school now!

Copyright ©2024, itechcollege.com. All rights reserved
iTechCollege | About iTech | Contact iTech