See code below. It works fine for numbers but if I enter a letter (eg 'a'), it will output 'first number 0 is divisible by second number, 6487956' without asking for input of second number.
#include<iostream>
using namespace std;
int main()
{
int first, second;
cout << "Please enter your first number (must be an integer) : " ;
cin >> first ;
cout << "Please enter your second number (must be an integer) : ";
cin >> second ;
if (first % second == 0)
cout << "The first number, " << first << ", is divisible by the second number, " << second << ".";
else
cout << "The first number, " << first << ", is not divisible by the second number, " << second << ".";
return 0;
}