Skip to content

Adding a tutorial for Dimik Even Odd 1 #434

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions dimik-even-odd-1/en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Dimik - Even Odd 1

In this problem, you will be given `T` testcases.Each line of the testcase consist of an integer `n`.We have to determine whether `n` is even or odd.

### Solution
* If n is divisible by 2
* its a even number so print 'even'
* if its not divisible by 2
* its a odd number so print 'odd'

### C++
```cpp
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
for (int k = 1; k <= t; k++)
{
int n;
cin >> n;
if (n % 2)
cout << "odd" << endl;
else
cout << "even" << endl;
}
}
```