adspace
how to write a program to accept names and marks of 10
students from the user and display the names and markes of
only the passed students. Marks greater than or equal to
35 is considered as pass.
Answer Posted / abikrishna
// Student Processing
#include <iostream>
using namespace std;
class Stud
{
public:
char name[20];
int marks[6];
};
int main ()
{
Stud s[11];int i,j,flag;
cout<<"\nEnter Name ";
for(i=0;i<10;i++)
cin>>s[i].name;
cout<<"\n Enter 5 marks ";
for(i=0;i<10;i++)
for(j=0;j<5;j++)
cin>>s[i].marks[j];
for(i=0;i<10;i++)
{flag=0;
for(j=0;j<5;j++)
if(s[i].marks[j]>=35)
flag++;
if(flag==5)
cout<<"\t"<<s[i].name;
}
return 0;
}
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
No New Questions to Answer in this Category !! You can
Post New Questions
Answer Questions in Different Category