You are on page 1of 2

/* ROLL NO: 1 SEM-1 ICA DIV: A

NAME : VARUN AGGARWAL SUBJECT: FOP


PROGRAM DEFINITION:Given a list of marks ranging from 0 to 100.
WAP to compute and print the number of students.
(a) Who have obtained more than 80 Marks.
(b) Who have obtained more than 60 Marks.
(c) Who have obtained more than 40 Marks.
(d) Who have obtained 40 or less than Marks.
(e) In the Range 81-100.
(f) In the Range 61-80.
(g) In the Range 41-60.
(h) In the Range 0-40.
the program should use miminum number of the statments.
*/

#include<stdio.h>
#include<conio.h>

int main()
{
int i,stud,mark,m_80=0,m_60=0,m_40=0,m_40_l=0;
int m_81_100=0,m_61_80=0,m_41_60=0,m_0_40=0;
clrscr();
printf("\nEnter the no of students : ");
scanf("%d",&stud);
for(i=1;i<=stud;i++)
{
printf("\nEnter the marks: ");
scanf("%d",&mark);
if(mark>80)
m_80++;
if(mark>60)
m_60++;
if(mark>40)
m_40++;
if(mark<=40)
m_40_l++;
if(mark>=81 && mark<=100)
m_81_100++;
if(mark>=61 && mark<=80)
m_61_80++;
if(mark>=41 && mark<=60)
m_41_60++;
if(mark>=0 && mark<=40)
m_0_40++;
}
printf("\n\n\nNumber of students having more than 80 marks are
%d",m_80);
printf("\n\nNumber of students having more than 60 marks are %d",m_60);
printf("\n\nNumber of students having more than 40 marks are %d",m_40);
printf("\n\nNumber of students having 40 or less marks are %d",m_40_l);
printf("\n\nNumber of students having marks in the range 81 to 100 are
%d",m_81_100);
printf("\n\nNumber of students having marks in the range 61 to 80 are
%d",m_61_80);
printf("\n\nNumber of students having marks in the range 41 to 60 are
%d",m_41_60);
printf("\n\nNumber of students having marks in the range 0 to 40 are
%d",m_0_40);
getch();
return 0;
}
/* Input:
Enter the no of students : 3
Enter the marks: 80
Enter the marks: 91
Enter the marks: 60
Output:
Number of students having more than 80 marks are 1
Number of students having more than 60 marks are 2
Number of students having more than 40 marks are 3
Number of students having 40 or less marks are 0
Number of students having marks in the range 81 to 100 are 1
Number of students having marks in the range 61 to 80 are 1
Number of students having marks in the range 41 to 60 are 1
Number of students having marks in the range 0 to 40 are 0
*/