🔒 Closed Coding programming

Status
Not open for further replies.

Shyepw009

Eternal Poster
maam/sir paturo po kung anong mali ko po kasi nag cocomplicated terminated po slamat po

#include<iostream.h>
using namespace std;

void main()
{
int no, i;
float marks[10], per=0, total=0;
clrscr();
cout<<"Enter number of subject: ";
cin>>no;
cout<<"Enter marks of "<<no<<" subject: ";
for(i=0; i<no; i++)
{
cin>>marks;
}
for(i=0; i<no; i++)
{
total=total+marks;
}
per=total/no;
cout<<"Percentage: "<<per<<" %" <<endl;
if(per>85) {
cout<<"A grade";
}
else if(per<85 && per>=75)
{
cout<<"B grade";
}
else if(per<75 && per>=50)
{
cout<<"C grade";
}
else if(per<50 && per>=30)
{
cout<<"D grade";
}
else
{
cout<<"Fail";
}
getch();
}
 
Status
Not open for further replies.

About this Thread

  • 1
    Replies
  • 353
    Views
  • 2
    Participants
Last reply from:
M3N3r

Trending Topics

Online now

Members online
1,025
Guests online
721
Total visitors
1,746

Forum statistics

Threads
2,276,959
Posts
28,973,344
Members
1,229,665
Latest member
hellowwolrd
Back
Top