Computer Science, asked by UNKNOWN021, 1 year ago

Write a program to create an array which stores the details of 25 students (name, rollno, marks in

four subjects) and print the list of students who have failed in more than one subject (passing

marks >= 30)

Answers

Answered by mohdqashif1
2
This is the full program just add header file conic and iostream in it
Attachments:

UNKNOWN021: do that and send me nah!!
Answered by abu7878
1

Answer:

The following is a program to create an array which stores the details of 25 students and print the names of students who have failed.

#include<iostream.h>

#include<conio.h>

struct stud

{

int roll;

char name[50];

float m1,m2,m3,m4;

};

typedf stud S;

void main()

{

S student[25];

For(int i=0;i<25;i++)

{

cout<<”\n enter roll number of the student: \n ”;

cin>>student[i].roll;

cout<<”\n enter name of the student: \n ”;

cin>>student[ch].name;

cout<<”\n enter marks scored in 4 subjects: \n ”;

cin>>student[i].m1>>student[i].m2>>student[i].m3>>student[i].m4;

}

cout<<”\n enter students who failed in more than 1 subject  \n”;

for(i=0;i<25;i++)

{

If((student[i].m1<30 && student[i].m2<30))||

(student[i].m2<30 && student[i].m3<30)||

((student[i].m1<30 && student[i].m3<30))

cout<<student[i].roll<<”\t”<<student[i].name<<”\n”;

}

getch();

}

Similar questions