0
Any funny algorithms for coding?
Hey! I have started with prime numbers finder (in my code) and I'm looking for some other entertaining algorithms. Please advice!
1 Answer
+ 1
//not funny but an interesting one.
//to find if the number is even or odd in a single line
int n = 10;
((n & 1) && cout<<"Odd" ) || cout <<"Even";