Input Number And Check Even or Odd

#include<iostream>

using namespace std; 

int main() 

{

int num; bool alt;

alt = false;

while (!false)

{

cout << "Enter Number " << endl; cin >> num;

if (num % 2 == 0)

cout << num << " is Divisible by 2" << endl;

else

if (num % 3 == 0)

cout << num << " is Divisible by 3" << endl;

else

cout << num << " is not Divisible by 2 and 3" << endl;

if (num % 2 == 0 || num % 3 == 0) alt = true;

}

system("pause");

}


Comments

Popular Posts