Write a C or C++ program to read marks of 4 subjects and find how many students are pass and fail with division.
This program to read marks of 4 subjects and find how many students are pass and fail with division.
To read marks of 4 subjects and find out how many students fall under the following categories:
a) avg<45 - Failb) 45 <= avg <55- Third Division
c) 55<= avg <60 - Second Division
d) 60<= avg <75 - First Division
e) avg >=75 - Distinction
Solution For C Program:
#include<stdio.h>
#include<conio.h>
main()
{
int f=0,t=0,s=0,F=0,d=0,n,i;
float fcp,iit,cag,stat;
printf("Enter the number of students\n");
scanf("%d",&n);
float avg[n];
for(i=0;i<n;i++)
{
printf("Enter marks of FCP , IIT , CAG , STAT respectively of %dth student\n",i+1);
scanf("%f%f%f%f",&fcp,&iit,&cag,&stat);
avg[i]=(fcp+iit+cag+stat)/4;
printf("Avrage=%f\n",avg[i]);
}
for(i=0;i<n;i++)
{
if(avg[i]<45)
f++;
if(avg[i]<75 && avg[i]>=60)
F++;
if(avg[i]<55 && avg[i]>=45)
t++;
if(avg[i]<60 && avg[i]>=55)
s++;
if(avg[i]>=75)
d++;
}
printf("The number of students with distinction = %d\n",d);
printf("The number of students with first division = %d\n",F);
printf("The number of students with second division = %d\n",s);
printf("The number of students with third division = %d\n",t);
printf("The number of failed students = %d\n",f);
getch();
}
Learn More :
Find
- Find out the perfect number using c program
- Find g.c.d of two number using c program.
- Write a c program to find out NCR factor of given number
- How to Write a C program to find maximum between two numbers ?
- Write a C program to find maximum between three numbers ?
- C Program turnLEDOn to Drives Forward Until It Finds The Line
- Write overloaded function templates for finding the roots of the linear (a * x + b = 0) and square (a * x2 + b * x + c = 0) uravneniy.Zamechanie: in function to send coefficients of the equations.
- C Program to Find Random Number
- C Program To Find LCM and HCF Of Two Number Using Function - 2
- C Program to find LCM and HCF Of Two Number Using Recursion - 3
- C Program To Find LCM and HCF Of Two Number -1
- C Program To Find Length Of A String Including Blank Spaces, Tabs, And Other Special Characters
- C Program To Find Length Of String And Concatenate Two Strings
- C Program To Find Product Of Two No Using MACRO
- C Program To Find Reverse Of Any Digit Number
- C Program To Find Sum and Difference Of Two Matrices
- C Program To Find The Frequency Of A Number
- C Program To Find The Length, Reverse Of A String And To Check It Is Palindrome or Not
- C Program To Find The Maximum And Minimum Value In An Array
- C Program To Find Transpose Of A Matrix
- C Program To Find Union & Intersection Of Two Array
- C Program Finding the sum of Squares using Recursion
- C Program to Find NCR Of A Given Number Program
- C Program To Find Maximum Of Given Numbers
Division
Marks
Student
Read
- Sort Three Numbers - program reads in three Integers and displays them in ascending order.
- C Program readers/writers
- C Program to Demonstrates use of reader/writer lock
- C Program to Write/Read Dynamic Data Example
- C Function to read instructions from the file and obey them
- A small I/O bound program to copy N bytes from an input file to an output file.
- Input reads in the array positions and range for random generation.
- C Program to Read and Write FIFO
- pthreads Readers/Writers Lock C Program
- C Program to opens and reads dictionary file specified in spellrc
- C Program reads in and spews out the attributes of a given .wav file.
- C Program Number of Judge and Score From Each Judge
- Read 10 real numbers using a vector and show the least of them C Program
- C Program To Read A Parenthesised Infix Expression From The User And Check Whether It Is Well Parenthesised Or Not
- C Program To Read The Adjecancy Matrix of Directed Graph And Convert It Into Adjecancy List
- C Program Read a char & print next char ( file to file )
- Menu Driven Program to Read Two Integers Find Sum, Difference and Product C Program