Skip to content

Commit 2857a03

Browse files
Basic
1 parent 2669d65 commit 2857a03

7 files changed

+65
-5
lines changed

.vscode/settings.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"files.associations": {
3+
"ostream": "cpp"
4+
}
5+
}

README.md

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
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.
26

7+
/////////RULES TO DECLARE VARIABLES IN CPP
38

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

header_files.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
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.

operators.cpp

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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+
}

operators.exe

47 KB
Binary file not shown.

user_input.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
int main(){
44
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*/
77
std::cout<< "Enter you first number:\n";
88
std:: cin>>b;
99
std:: cout<< "The sum of a and b is:\n"<< a+b;

variables&typecasting.cpp

Whitespace-only changes.

0 commit comments

Comments
 (0)