Skip to content

Commit

Permalink
feeling tired ...
Browse files Browse the repository at this point in the history
  • Loading branch information
KaziRifatMorshed committed Aug 18, 2024
1 parent 5902de1 commit 749e120
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 94 deletions.
185 changes: 94 additions & 91 deletions src/Operator_and_Expression/Operator_and_Expression.md
Original file line number Diff line number Diff line change
@@ -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 <stdio.h>

~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 <stdio.h>

~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;
~}
```
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 <stdio.h>

~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 <stdio.h>

~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;
~}
```
7 changes: 4 additions & 3 deletions src/StartHere/Books_Tutorials.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) |

Expand All @@ -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)

Expand Down

0 comments on commit 749e120

Please sign in to comment.