Skip to main content
added 192 characters in body
Source Link
oosterwal
  • 1.7k
  • 14
  • 16

Here's one to provoke some thought--It's straightforward, involves a bit of math, and checks the candidate's knowledge level of basic computer design (overflow, numeric representation, etc):

Write a program (or procedure) that takes a pair of integers X, Y as input and determines whether XY is evenly divisible by 10. IMPORTANT NOTE: X and Y may be large enough that XY overflows the largest integer type available on your machine.


Sample solution:

T_BOOL MultipleOfTen(int x, int y)
{
    return((x%2==0 || y%2==0) && (x%5==0 || y%5==0));
}

Here's one to provoke some thought--It's straightforward, involves a bit of math, and checks the candidate's knowledge level of basic computer design:

Write a program (or procedure) that takes a pair of integers X, Y as input and determines whether XY is divisible by 10. IMPORTANT NOTE: X and Y may be large enough that XY overflows the largest integer type available on your machine.

Here's one to provoke some thought--It's straightforward, involves a bit of math, and checks the candidate's knowledge of basic computer design (overflow, numeric representation, etc):

Write a program (or procedure) that takes a pair of integers X, Y as input and determines whether XY is evenly divisible by 10. IMPORTANT NOTE: X and Y may be large enough that XY overflows the largest integer type available on your machine.


Sample solution:

T_BOOL MultipleOfTen(int x, int y)
{
    return((x%2==0 || y%2==0) && (x%5==0 || y%5==0));
}
Source Link
oosterwal
  • 1.7k
  • 14
  • 16

Here's one to provoke some thought--It's straightforward, involves a bit of math, and checks the candidate's knowledge level of basic computer design:

Write a program (or procedure) that takes a pair of integers X, Y as input and determines whether XY is divisible by 10. IMPORTANT NOTE: X and Y may be large enough that XY overflows the largest integer type available on your machine.

Post Made Community Wiki