Thanks problem solved....
it was just initial = 0;
however there is another problem
i entered 10 ascending number : 1 2 3 4 5 6 7 8 9 10
now if i enter number to be searched = 5
then it will show present status
however if i will search 12(which is obviously not there)
it(Console) just keeps on blinking and i have to terminate it with Ctr + c
and win task manager shows CPU USAGE = 100%
as soon as i terminate it gets down too
whats the problem