Explore Westonci.ca, the top Q&A platform where your questions are answered by professionals and enthusiasts alike. Experience the ease of finding quick and accurate answers to your questions from professionals on our platform. Join our Q&A platform to connect with experts dedicated to providing accurate answers to your questions in various fields.

Lab 5A Problem Input two DWORD values from the keyboard. Determine which number is larger or if they are even. Your program should look like the following: First number larger Enter a number 12 Enter a number 10 12 is the larger number Press any key to close this window... Second number larger Enter a number 10 Enter a number 12 12 is the larger number Press any key to close this window... Numbers Equal Enter a number 12 Enter a number 12 Numbers are equal Press any key to close this window...

Sagot :

Answer:

Explanation:

#include<iostream>

using namespace std;

int main()

{

int n1,n2;

cout<<"Enter a number:"<<endl; //Entering first number

cin>>n1;

cout<<"Enter a number:"<<endl; //Entering second number

cin>>n2;

if(n1%2==0 && n1%2==0) //Checking whether the two number are even or not

{

if(n1>n2)

{

cout<<n1<<" is the larger number"<<endl;

}

else if(n1==n2)

{

cout<<"Numbers are equal"<<endl;

}

else

{

cout<<n2<<" is the larger number"<<endl;

}

}

else

{

cout<<"The number are not even"<<endl;

}

}