Consider the test input:
1
9
Edit:
Also, pay attention to compiler warnings!
[simon@simon-laptop][13:22:06]
[~/devel/hackerrank/otherpeoples]>g++ -std=c++17 abhijeet_26-PRB01.cpp -O3 -g3 -Wall -Wextra
abhijeet_26-PRB01.cpp: In function ‘bool is_prime(int)’:
abhijeet_26-PRB01.cpp:15:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
1 Like