I was solving this question on SPOJ - http://www.spoj.com/problems/ALICESIE/
What the question boils down to print (n+1)/2
This is my C code which passes in
You're comparing compiled code with a script language (Bash).
Bash scripts will always be slower than compiled code as they need to be interpreted.
As you probably know, in order to run your code written in C you first need to compile it. When it comes to Bash scripts, you don't have to read it, the code is just "read on the fly". So Bash is slower than C.