KEMBAR78
IP 4 Output | PDF
0% found this document useful (0 votes)
9 views1 page

IP 4 Output

The provided C program calculates the percentage of marks obtained in five subjects. It prompts the user to input marks, computes the average, and determines the division based on the average percentage, while also checking if the student has passed. If any subject mark is below 40, the program outputs 'FAIL'.

Uploaded by

hs005807
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views1 page

IP 4 Output

The provided C program calculates the percentage of marks obtained in five subjects. It prompts the user to input marks, computes the average, and determines the division based on the average percentage, while also checking if the student has passed. If any subject mark is below 40, the program outputs 'FAIL'.

Uploaded by

hs005807
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Programiz PRO

C Online Compiler

main.c Output

1 #include <stdio.h>
2 int main() {
3
4 float a,b,c,d,e,percent;
5
6 printf ("marks in subject 1: ");
7 scanf ("%f",&a);
8 printf ("marks in subject 2: ");
9 scanf ("%f",&b);
10 printf ("marks in subject 3: ");
11 scanf ("%f",&c);
12 printf ("marks in subject 4: ");
13 scanf ("%f",&d);
14 printf ("marks in subject 5: ");
15 scanf ("%f",&e);
16 percent=(a+b+c+d+e)/5;
17 if ( a>=40 &&b>=40 &&c>=40 &&d>=40 &&e>=40) {
18 if(percent>=75){
19 printf("Distinction");
20 }
21 else if(percent>=60 && percent<75){
22 printf("First Division");
23 }
24 else if(percent>=50 && percent<60){
25 printf("Second Division");
26 }
27 else {
28 printf("Third Division");
29 }
30 }
31 else {
32 printf("FAIL");
33 }
34 return 0;
35 }

Run

You might also like