👤

Given two numbers as input, print the message "Hello world" if they are both a multiple of 5, "Hello" if only the first number is a multiple of 5, and "world" if only the second number is a multiple of 5.

Răspuns :

Răspuns:

#include <iostream>

using namespace std;

int main()

{int a,b;

cout<<"Enter the numbers: ";

cin>>a>>b;

if(a%5==0 && b%5==0)

cout<<"Hello World";

else

if(a%5==0)

cout<<"Hello";

else

if(b%5==0)

cout<<"World";

   return 0;

}

Explicație: