C++ Searches for Even, Odd or Zero Integers (CSEOZI)


CSEOZI:   SOLD       




In this discussion, it is still about the statements "if", "else if" or "else". However, for the operator that we will discuss this time is about modulus or in C++ programming is stated with "%" which means the remainder value. For more details, please see the simple review below:


1. Even


2. Odd


3. Zero

Source Code:

#include<iostream.h>
#include<conio.h>

/**
*bundet.com
*Menentukan Bilangan Bulat, Genap, Ganjil atau Nol
*/

void main() {
    int a;
    cout << "menentukan bilangan bulat genap/ganjil/nol \n";
    cout << "masukkan bilangan : "; cin >> a;

    if ( a == 0 )
        cout << "bilangan nol " << endl;
    else if ( a % 2 == 0 )
        cout << "bilangan genap " << endl;
    else
        cout << "bilangan ganjil " << endl;

    getch();
}

That's it, bro, I hope it can be useful. If you have any questions, please just comment below. Thank you.


2 Comments

  1. Hello i would like to see another NFT like this but maybe like one watch

    ReplyDelete
    Replies
    1. For now, it seems like there are only a few models like this, one of them is this

      C++ Integer and Unsigned Integer Data Range (CIUIDR)

      Maybe someday if there is one that is close to your taste, I will let you know

      Delete
Previous Next

نموذج الاتصال