C program to check whether the given marks are pass or fail

VIGNESWARAN.S
2 min readJun 11, 2021

What we are going to learn from this program?

In this program ,we are going to learn about the given marks are pass or fail.It will give the total result for the given marks.

Algorithm

Step1:Declare three variables for entering marks

Step2:If marks of the three subjects is greater than 40 Then print the statement as “pass”

Step3:Else print the statement “Fail”

Flowchart

Explanation

  1. Initially we usually gives #include<stdio.h>and #include<conio.h>

2.Second is main part.

→Declare the variables s1,s2,s3

→print the statement “Enter marks of sub1,sub2,sub3

→Inside the scanf %d is used for int data type.

→Then if else statement

→If the subjects are greater than 40 and satisfies the condition,print the statement as “Pass”

→If the condition is not satisfied,it will go to the else part and the statement will be printed as “Fail”

Program or Source code

Output

If the marks are greater than 40,the output is

If the marks are lesser than 40, the output is

For any Reference

--

--