-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththird.cpp
More file actions
45 lines (41 loc) · 1.46 KB
/
Copy paththird.cpp
File metadata and controls
45 lines (41 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// five cpp file
#include<iostream> // there are two types of header files in c++ : 1- system header files : it comes with the compiler 2- user defined header files : it is written by the programmer
using namespace std;
int main()
{
/*
int num1, num2;
cout<<"enter the value of num1 : "; // "<<" insertation operator
cin>>num1; // ">>" extraction operator
cout<<"enter the value of num2 : ";
cin>>num2;
cout<<"the sum is "<<num1+num2<<endl;
sixth cpp file
operators in c++ :
1- arithmetic operators : + - * / % ++ --
int a = 4, b = 5;
cout<< "The sum is: "<< a+b<<endl;
cout<< "The sub is: "<< a-b<<endl;
cout<< "The mul is: "<< a*b<<endl;
cout<< "The div is: "<< a/b<<endl;
cout<< "The mod is: "<< a%b<<endl;
cout<< "The inc is: "<< a++<<endl;
cout<< "The dec is: "<< a--<<endl;
cout<< "The inc is: "<< ++a<<endl;
*/
// 2- assignment operators : = += -= *= /= %=
int a = 3, b = 9;
int c1 = a+b;
// 3- comparison operators : == != > < >= <=
// 4- logical operators : && || !
// 5- bitwise operators : & | ^ ~ << >>
// 6- ternary operator : ?:
// 7- sizeof operator : sizeof()
// 8- comma operator : ,
// 9- member selection operator : . ->
// 10- address of operator : &
// 11- pointer to member operator : .*
// 12- new and delete operators : new delete
// 13- type cast operator : (type)
return 0;
}