From 749e1204cb89ef43742300e96a931abd6e5907b7 Mon Sep 17 00:00:00 2001 From: Kazi Rifat Morshed Date: Sun, 18 Aug 2024 10:56:17 +0600 Subject: [PATCH] feeling tired ... --- .../Operator_and_Expression.md | 185 +++++++++--------- src/StartHere/Books_Tutorials.md | 7 +- 2 files changed, 98 insertions(+), 94 deletions(-) diff --git a/src/Operator_and_Expression/Operator_and_Expression.md b/src/Operator_and_Expression/Operator_and_Expression.md index 3e68d96..d3ac2ee 100644 --- a/src/Operator_and_Expression/Operator_and_Expression.md +++ b/src/Operator_and_Expression/Operator_and_Expression.md @@ -1,97 +1,100 @@ # Operator & Expression - ## Problems + * ***Click on the title of the problem to submit your solution before looking at our solution.*** * ***We discourage looking at our solution before attempting to solve it by yourself first.*** -1. **[Simple Calculator](https://vjudge.net/problem/Gym-287306C)** - - Given two numbers X and Y. Print the summation and multiplication and subtraction of these 2 numbers. - - ***Input*** - - Only one line containing two separated numbers \\(X, Y (1  ≤  X, Y  ≤  10 ^ 5)\\) - - ***Output*** - - Print 3 lines that contain the following in the same order: - - 1. "\\(X + Y =\\) **summation result**" without quotes. - 2. "\\(X * Y =\\) **multiplication result**" without quotes. - 3. "\\(X - Y =\\) **subtraction result**" without quotes. - - ***Examples*** - - Input - ``` - 5 10 - ``` - - Output - ``` - 5 + 10 = 15 - 5 * 10 = 50 - 5 - 10 = -5 - ``` - - ***Notes*** - - **Be careful with spaces.** - - Hint: - ```hint - Press the eye icon to reveal hint. - ~ Use long long int instead of int - ~ Don't forget to use the designated format specifier for long long int (%lld) - ``` - - **Solution** - - ```c - // Press the eye icon to reveal solution. - ~#include - - ~int main() - ~{ - ~ long long x, y; - ~ - ~ scanf("%lld %lld", &x, &y); - ~ - ~ printf("%lld + %lld = %lld\n", x, y, x + y); - ~ printf("%lld * %lld = %lld\n", x, y, x * y); - ~ printf("%lld - %lld = %lld\n", x, y, x - y); - ~ - ~ return 0; - ~} - ``` - -2. **[Difference](https://vjudge.net/problem/Gym-287306D)** - - Hint: - - ```hint - Press the eye icon to reveal hint. - ~ Use long long int instead of int - ~ Don't forget to use the designated format specifier for long long int (%lld) - ``` - - **Solution** - - ```c - // Press the eye icon to reveal solution. - ~#include - - ~int main() - ~{ - ~ long long a, b, c, d, x; - ~ - ~ scanf("%lld %lld %lld %lld", &a, &b, &c, &d); - ~ - ~ x = (a * b) - (c * d); - ~ - ~ printf("Difference = %lld\n", x); - ~ - ~ return 0; - ~} - ``` \ No newline at end of file +1. **[Simple Calculator ↗️](https://vjudge.net/problem/Gym-287306C)** + + Given two numbers X and Y. Print the summation and multiplication and subtraction of these 2 numbers. + + ***Input*** + + Only one line containing two separated numbers \\(X, Y (1  ≤  X, Y  ≤  10 ^ 5)\\) + + ***Output*** + + Print 3 lines that contain the following in the same order: + + 1. "\\(X + Y =\\) **summation result**" without quotes. + 2. "\\(X \* Y =\\) **multiplication result**" without quotes. + 3. "\\(X - Y =\\) **subtraction result**" without quotes. + + ***Examples*** + + Input + + ``` + 5 10 + ``` + + Output + + ``` + 5 + 10 = 15 + 5 * 10 = 50 + 5 - 10 = -5 + ``` + + ***Notes*** + + **Be careful with spaces.** + + Hint: + + ```hint + Press the eye icon to reveal hint. + ~ Use long long int instead of int + ~ Don't forget to use the designated format specifier for long long int (%lld) + ``` + + **Solution** + + ```c + // Press the eye icon to reveal solution. + ~#include + + ~int main() + ~{ + ~ long long x, y; + ~ + ~ scanf("%lld %lld", &x, &y); + ~ + ~ printf("%lld + %lld = %lld\n", x, y, x + y); + ~ printf("%lld * %lld = %lld\n", x, y, x * y); + ~ printf("%lld - %lld = %lld\n", x, y, x - y); + ~ + ~ return 0; + ~} + ``` + +2. **[Difference ↗️](https://vjudge.net/problem/Gym-287306D)** + + Hint: + + ```hint + Press the eye icon to reveal hint. + ~ Use long long int instead of int + ~ Don't forget to use the designated format specifier for long long int (%lld) + ``` + + **Solution** + + ```c + // Press the eye icon to reveal solution. + ~#include + + ~int main() + ~{ + ~ long long a, b, c, d, x; + ~ + ~ scanf("%lld %lld %lld %lld", &a, &b, &c, &d); + ~ + ~ x = (a * b) - (c * d); + ~ + ~ printf("Difference = %lld\n", x); + ~ + ~ return 0; + ~} + ``` diff --git a/src/StartHere/Books_Tutorials.md b/src/StartHere/Books_Tutorials.md index b8b178f..9a58f1b 100644 --- a/src/StartHere/Books_Tutorials.md +++ b/src/StartHere/Books_Tutorials.md @@ -9,7 +9,7 @@ Now let's get you started on your learning journey. Choose any of the following | Resource | Medium | Link | | - | - | - | -| Harvard CS50 | English (Youtube Playlist | [Playlist](https://youtube.com/playlist?list=PLhQjrBD2T381WAHyx1pq-sBfykqMBI7V4\&si=45C8iSl3q8JbDCvB) | +| Harvard CS50 | English (Youtube Playlist) | [Playlist](https://youtube.com/playlist?list=PLhQjrBD2T381WAHyx1pq-sBfykqMBI7V4\&si=45C8iSl3q8JbDCvB) | | Tamim Shahriar Subeen | Free Bangla (Book) | [CPBook part 1](http://cpbook.subeen.com/) | | Anisul Islam Youtube Playlist | Bangla (Video) | [C Programming](https://www.youtube.com/playlist?list=PLgH5QX0i9K3pCMBZcul1fta6UivHDbXvz) | @@ -20,8 +20,9 @@ GeeksForGeeks A Book, ANSI C by E Balaguruswamy More Resources: -MIT OpenCourseWare -https://nptel.ac.in + +* MIT OpenCourseWare +* https://nptel.ac.in ![tutorial\_hell\_meme\_2](https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3fag6b2j8bc5a0i3xolu.png)