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
Post a Comment
Please do not enter any spam link in the comment box.