This repository was archived by the owner on May 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modification when shift from windows to linux
- Loading branch information
1 parent
5f98cfe
commit 9c6212b
Showing
89 changed files
with
2,960 additions
and
2,960 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
#include <iostream> | ||
using namespace std; | ||
|
||
int main(void) | ||
{ | ||
int a, b, c; | ||
cout << "Enter 2 Numbers: "; | ||
cin >> a >> b; //Input from Console | ||
|
||
c = a + b; | ||
|
||
cout << "Addition = " << c << endl; | ||
return 0; | ||
#include <iostream> | ||
using namespace std; | ||
|
||
int main(void) | ||
{ | ||
int a, b, c; | ||
cout << "Enter 2 Numbers: "; | ||
cin >> a >> b; //Input from Console | ||
|
||
c = a + b; | ||
|
||
cout << "Addition = " << c << endl; | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
#include <iostream> | ||
using namespace std; | ||
|
||
int main(void) | ||
{ | ||
float radius, area; | ||
|
||
cout << "Enter Radius: "; | ||
cin >> radius; | ||
area = 3.1425f * radius * radius; | ||
|
||
cout << "Area is " << area; | ||
|
||
return 0; | ||
#include <iostream> | ||
using namespace std; | ||
|
||
int main(void) | ||
{ | ||
float radius, area; | ||
|
||
cout << "Enter Radius: "; | ||
cin >> radius; | ||
area = 3.1425f * radius * radius; | ||
|
||
cout << "Area is " << area; | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
#include <iostream> | ||
using namespace std; | ||
|
||
int main(void) | ||
{ | ||
//Variables | ||
float area, height, base; | ||
//Taking User Input | ||
cout << "Enter Base & Height Respectively: "; | ||
cin >> base >> height; | ||
//Calculating Area of Triangle | ||
area = (base * height) / 2; | ||
//Printing Area to the console | ||
cout << area << endl; | ||
|
||
return 0; | ||
#include <iostream> | ||
using namespace std; | ||
|
||
int main(void) | ||
{ | ||
//Variables | ||
float area, height, base; | ||
//Taking User Input | ||
cout << "Enter Base & Height Respectively: "; | ||
cin >> base >> height; | ||
//Calculating Area of Triangle | ||
area = (base * height) / 2; | ||
//Printing Area to the console | ||
cout << area << endl; | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
#include <iostream> | ||
using namespace std; | ||
|
||
int main() | ||
{ | ||
int sum = 10, x = 5; | ||
sum += x; | ||
cout << sum << endl; | ||
|
||
int fact = 10, y = 5; | ||
fact *= y; | ||
cout << fact << endl; | ||
|
||
return 0; | ||
#include <iostream> | ||
using namespace std; | ||
|
||
int main() | ||
{ | ||
int sum = 10, x = 5; | ||
sum += x; | ||
cout << sum << endl; | ||
|
||
int fact = 10, y = 5; | ||
fact *= y; | ||
cout << fact << endl; | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
#include <iostream> //Preprocessor Directive | ||
using namespace std; //Global Namespace | ||
|
||
int main(void) | ||
{ | ||
cout << "Hello World" << endl; //Output to Console | ||
// cin << Insertion Operator | ||
// cout >> Extraction Operator | ||
return 0; | ||
#include <iostream> //Preprocessor Directive | ||
using namespace std; //Global Namespace | ||
|
||
int main(void) | ||
{ | ||
cout << "Hello World" << endl; //Output to Console | ||
// cin << Insertion Operator | ||
// cout >> Extraction Operator | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
#include <iostream> | ||
using namespace std; | ||
|
||
int main() | ||
{ | ||
int i = 5, j; | ||
j = i++; | ||
cout << j << " " << i << endl; | ||
|
||
int k = 5, l; | ||
l = ++k; | ||
cout << l << " " << k << endl; | ||
|
||
int a = 5, b; | ||
b = 2 * ++a + 2 * a++; | ||
cout << b << " " << a << endl; | ||
|
||
int c = 5, d; | ||
d = 2 * c++ + 2 * c++; | ||
cout << d << " " << c << endl; | ||
|
||
return 0; | ||
#include <iostream> | ||
using namespace std; | ||
|
||
int main() | ||
{ | ||
int i = 5, j; | ||
j = i++; | ||
cout << j << " " << i << endl; | ||
|
||
int k = 5, l; | ||
l = ++k; | ||
cout << l << " " << k << endl; | ||
|
||
int a = 5, b; | ||
b = 2 * ++a + 2 * a++; | ||
cout << b << " " << a << endl; | ||
|
||
int c = 5, d; | ||
d = 2 * c++ + 2 * c++; | ||
cout << d << " " << c << endl; | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
#include <iostream> | ||
#include <string> | ||
using namespace std; | ||
|
||
int main(void) | ||
{ | ||
string name; | ||
cout << "May I know Your Name ?" << endl; | ||
getline(cin, name); //cin>>name; | ||
|
||
cout << "Welcome! " << name << endl; | ||
|
||
return 0; | ||
#include <iostream> | ||
#include <string> | ||
using namespace std; | ||
|
||
int main(void) | ||
{ | ||
string name; | ||
cout << "May I know Your Name ?" << endl; | ||
getline(cin, name); //cin>>name; | ||
|
||
cout << "Welcome! " << name << endl; | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
#include <iostream> | ||
using namespace std; | ||
|
||
int main() | ||
{ | ||
char a = 128; | ||
cout << (int)a << endl; | ||
|
||
char b = 127; | ||
b++; | ||
cout << (int)b << endl; | ||
|
||
char c = -129; | ||
cout << (int)c << endl; | ||
|
||
char d = -128; | ||
d--; | ||
cout << (int)d << endl; | ||
|
||
int e = INT_MAX; | ||
e++; | ||
cout << (int)e << endl; | ||
|
||
return 0; | ||
#include <iostream> | ||
using namespace std; | ||
|
||
int main() | ||
{ | ||
char a = 128; | ||
cout << (int)a << endl; | ||
|
||
char b = 127; | ||
b++; | ||
cout << (int)b << endl; | ||
|
||
char c = -129; | ||
cout << (int)c << endl; | ||
|
||
char d = -128; | ||
d--; | ||
cout << (int)d << endl; | ||
|
||
int e = INT_MAX; | ||
e++; | ||
cout << (int)e << endl; | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
#include <iostream> | ||
#include <cmath> | ||
using namespace std; | ||
//Finding the root of a Quadratic Equation | ||
int main(void) | ||
{ | ||
float a, b, c, x1, x2; | ||
|
||
cout << "Enter the coefficients of x^2, x and constant terms respectively: "; | ||
cin >> a >> b >> c; | ||
|
||
x1 = (-b + sqrt((b * b) - (4 * a * c))) / (2 * a); | ||
x1 = (-b - sqrt((b * b) - (4 * a * c))) / (2 * a); | ||
|
||
cout << "\nRoots are:\n" | ||
<< "x1 = " << x1 << " x2 = " << x2 << endl; | ||
|
||
return 0; | ||
#include <iostream> | ||
#include <cmath> | ||
using namespace std; | ||
//Finding the root of a Quadratic Equation | ||
int main(void) | ||
{ | ||
float a, b, c, x1, x2; | ||
|
||
cout << "Enter the coefficients of x^2, x and constant terms respectively: "; | ||
cin >> a >> b >> c; | ||
|
||
x1 = (-b + sqrt((b * b) - (4 * a * c))) / (2 * a); | ||
x1 = (-b - sqrt((b * b) - (4 * a * c))) / (2 * a); | ||
|
||
cout << "\nRoots are:\n" | ||
<< "x1 = " << x1 << " x2 = " << x2 << endl; | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
#include <iostream> | ||
using namespace std; | ||
|
||
int main(void) | ||
{ | ||
float u, v, a; //initial_velocity, final_velocity, acceleration | ||
cout << "Enter Values: "; | ||
cin >> u >> v >> a; | ||
|
||
//Calculating speed using formula | ||
int speed = ((v * v) - (u * u)) / (2 * a); | ||
|
||
cout << "Speed = " << speed << endl; | ||
|
||
return 0; | ||
#include <iostream> | ||
using namespace std; | ||
|
||
int main(void) | ||
{ | ||
float u, v, a; //initial_velocity, final_velocity, acceleration | ||
cout << "Enter Values: "; | ||
cin >> u >> v >> a; | ||
|
||
//Calculating speed using formula | ||
int speed = ((v * v) - (u * u)) / (2 * a); | ||
|
||
cout << "Speed = " << speed << endl; | ||
|
||
return 0; | ||
} |
Oops, something went wrong.