Write a program to check if a student passed or failed.

 //marks >=35 is pass other wise fail.

#include<stdio.h>

#include<math.h>


int main()


{

int marks;

printf("enter marks(0-100)\n");

scanf("%d", &marks);

if(marks>=35 && marks<=100){

printf("pass");

}

else if(marks<=0 || marks<35){

printf("fail");

}

else{

printf("invalid marks");

}

return 0;

}

Output :

enter marks

45

student is pass

--------------------------------

Process exited after 8.051 seconds with return value 0

Press any key to continue . . .



Comments

Popular posts from this blog

Write a program to check if a number is prime or not.

Write a program to print the grades to a student.

write a program (keep taking numbers as input from user until user enters an Odd number)