File tree 7 files changed +65
-5
lines changed
7 files changed +65
-5
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ "files.associations" : {
3
+ "ostream" : " cpp"
4
+ }
5
+ }
Original file line number Diff line number Diff line change 1
- ` FUCK YOUR MOTEHRFUCKER `
1
+ 1 . In Cpp language True and flase represent 1 and 0 resp.
2
+ 2 . We can make local and global variable with same name but prefrence will given to local on but if u use "::"before varible then it will use global variable
3
+ 3 . void function will not return anyting "that why it is void == 0"
4
+ 4 . "<<" is called as Insertion operator.
5
+ 4 . "<<" is called as Extraction operator.
2
6
7
+ /////////RULES TO DECLARE VARIABLES IN CPP
3
8
4
-
5
- ![ iyby22xd66491 ] ( https://github.com/user-attachments/assets/4f452960-71b5-4f84-8ff3-0ad34ac81e46 )
9
+ 1 . Varible name in cpp can range from 1 to 255 char.
10
+ 2 . Varible name do not start with num
Original file line number Diff line number Diff line change
1
+ // There are two type of header files:
2
+
3
+ // 1. System header files It comes with the compiler.
4
+ // eg: #include<iostream>
5
+
6
+ // 2. User defined header files : It is written by the user.
7
+ // eg: #include"this.h" --> This will produce an error if the this.h will not present in same directory.
Original file line number Diff line number Diff line change
1
+ #include < iostream>
2
+ using namespace std ;
3
+
4
+ int main (){
5
+
6
+ int a=4 ,b=5 ;
7
+
8
+ cout<< " Following are the types of operators in c++:" <<endl;
9
+ // Arthmetic operators
10
+ cout<<" The value of a+b is " <<a+b<<endl;
11
+ cout<<" The value of a-b is " <<a-b<<endl;
12
+ cout<<" The value of a*b is " <<a*b<<endl;
13
+ cout<<" The value of a/b is " <<a/b<<endl;
14
+ cout<<" The value of a%b is " <<a%b<<endl;
15
+ cout<<" The value of a++ is " <<a++<<endl;
16
+ cout<<" The value of a-- is " <<a--<<endl;
17
+ cout<<" The value of ++a is " <<++a<<endl;
18
+ cout<<" The value of --a is " <<--a<<endl;
19
+ cout<<endl;
20
+
21
+ // Assignment Operators --> Used to assign values to variables
22
+ // int a=3, b=9;
23
+ // chat d="A";
24
+
25
+ // Comparison Operators
26
+ cout<<" Following are the types of compatison opeators in C++" <<endl;
27
+ cout<<" The vlaue of a==b is " <<(a==b)<<endl;
28
+ cout<<" The vlaue of a!=b is " <<(a!=b)<<endl;
29
+ cout<<" The vlaue of a>=b is " <<(a>=b)<<endl;
30
+ cout<<" The vlaue of a<=b is " <<(a<=b)<<endl;
31
+ cout<<" The vlaue of a>b is " <<(a>b)<<endl;
32
+ cout<<" The vlaue of a<b is " <<(a<b)<<endl;
33
+ cout<<endl;
34
+
35
+ // Logical Operators
36
+ cout<< " Following are the logical operators in C++" <<endl;
37
+ cout<< " The value of (a==b)&&(a<b) logical operator is " <<((a==b)&&(a<b))<<endl;
38
+ cout<< " The value of (a==b)||(a<b) logical operator is " <<((a==b)||(a<b))<<endl;
39
+ cout<< " The value of !((a==b)||(a<b)) is " <<(!(a==b)||(a<b))<<endl;
40
+
41
+ return 0 ;
42
+
43
+ }
Original file line number Diff line number Diff line change 2
2
3
3
int main (){
4
4
int a,b;
5
- std::cout<< " Enter you first number:\n " ;
6
- std:: cin>>a;
5
+ std::cout<< " Enter you first number:\n " ; /* << is called instertion operator */
6
+ std:: cin>>a;/* >> is called extraction operator */
7
7
std::cout<< " Enter you first number:\n " ;
8
8
std:: cin>>b;
9
9
std:: cout<< " The sum of a and b is:\n " << a+b;
You can’t perform that action at this time.
0 commit comments