- 1
Write a program to check whether a number is a magic number or not.
3 ответов
+ 2
#include <stdio.h>
bool is_magic_number(int a)
{
return ((a % 9) == 1);
}
int main()
{
// Print out all 'magic' numbers, that are less than a hundred.
for (int i = 0; i < 100; i++)
{
if (is_magic_number(i))
{
printf("%d\n", i);
}
}
}
+ 4
What magic number are you talking about?
+ 2
Numbers that give 1 as remainder when divided by 9