NUMBER DEFINITION - 100% WORKS


posted on Nov. 18, 2021, 21:04

Hello every body, today, I will tell you how to make a number definitor. This ND will define a number is an even/an odd/a negative even/a negative odd or that's just equal 0. Now, let's get started. Check the code inside the box (Below the "Code zone" text) and copy it into your program. (Code::Blocks strongly recommended) CODING TYPE = CPP (C++)

SPECIAL ZONE!!!: 🎞 Subcribe to my youtube at: 👉 https://www.youtube.com/channel/UCvpqlnV29UZks3FsiZGs75w. No video yet, sorry :)

Code zone:

#include <bits/stdc++.h>
using namespace std;

int main() {
    int a;
    cout << "Please enter the number you would like to define" << endl;
    cin >> a;
    if (a > 0 && a % 2 == 0) cout << "NUMBER TYPE:EVEN" << endl;
    else if (a > 0 && a % 2 == 1) cout << "NUMBER TYPE:ODD" << endl;
    else if (a < 0 && a % 2 == 0) cout << "NUMBER TYPE: NEGATIVE EVEN" << endl;
    else if (a < 0 && a % 2 == -1) cout << "NUMBER TYPE: NEGATIVE ODD" << endl;
    else cout << "THE NUMBER IS EQUAL 0" << endl;
    return 0;
}

FEEL FREE TO COMMAND BELOW IF YOU GET THE ERROR WHILE CODING :)


Comments

Please read the guidelines before commenting.



  • 1
    idolgioitre  commented on 19, Nov, 2021, 19:48

    Dạ cho em hỏi cái này nghĩa là j v ạ


  • 8
    leduykhongngu  commented on 18, Nov, 2021, 21:05

    Nhắc lại, mình thấy các blog của bạn không tạo ra tính giá trị lớn cho cộng đồng, bạn xem xét trước khi đăng nhé. Một lần nữa mình sẽ cấm bạn đăng blog.