C program to check pass or fail