I want to write a program that enter the marks of n of student out of 100%, students who are (marks>=65) pass otherwise failed, want to print number of students who'r passed and failed ?

I solved but wont work ><

To enter nth marks of student need loop, then use if, else
but how can I print the number.

This is totally wrong :'(


want to dispaly only the marks and number of students who'r passed and failed.

# include <iostream>

using namespace std;

int main ()

{
    int marks,i,stu_pa=0,stu_fa=0,sum=0;
    
    cin>>num;
    
    for(i=1;i<=num;i++)
    {
       cout<<"Enter the marks of student out 100: ";
       cin>>marks;
       
       if(marks>=65)
       {
                stu_pa=num;
                cout<<stu_pa<<"\npassed\n"<<endl;
       }
       
       else
       {
                stu_fa=nun-stu_pa;
                cout<<stu_fa<<"\nfailed\n"<<endl;
       }
               
     
     }

}
#include <iostream>

using namespace std;

int main ()
{
   int marks, i, stu_pa = 0, stu_fa = 0, sum = 0;
   cin >> num;

   for ( i = 1; i <= num; i++ )
   {
      cout << "Enter the marks of student out 100: ";
      cin >> marks;
      if ( marks >= 65 )
      {
         stu_pa = num;
         cout << stu_pa << "\npassed\n" << endl;
      }
      else
      {
         stu_fa = nun - stu_pa;
         cout << stu_fa << "\nfailed\n" << endl;
      }
   }
}

num is undeclared and so is nun?

oh i wrote it quickly >< even if i correct them still wont work.

This article has been dead for over six months. Start a new discussion instead.