Enter 10 student grades and print the total number of passing and failing grades entered

Comments
This is a simple program that only requires a loop, a few conditional statements, and maybe an array and a int variable. How hard can that be?
Lazy AND rude.

Enter 10 student grades and print the total number of passing and failing grades entered

Since you can't be bothered to even ask politely then I'll just answer impolitely with "do your own bloody homework."

@rproffitt: amazing as it may seem, some teachers still work with Turbo C. I guess some countries don't (or can't) provide enough money for their education system. Hence Turbo C is better than nothing. Or: the teacher is still stuck in the previous century and doesn't "evolve". Which is bad and sad.

@joshua_14: we don't do your homework for you. Show us what you got and we'll try to help.

@ddanbe, I had to ask since last year a new hire was stumbling around as we use gcc and later compilers. As to cost, the new online fiddles are currently free but if a teacher is stuck in the 1980's what is to be done but ask. I had to tell the new hire to stop calling the errors "compiler bugs."

Actually, in India and Pakistan, it is even worse that that: last I heard (as recently as last summer), the national university systems continue to mandate the use of Turbo C++ 1.5 as the standard C/C++ compiler, and professors are forbidden to use anything else for introductory C++ courses (whether they can use other languages in introductory courses wasn't clear, but aparently the scholastic exams are all based on C++, and the tests haven't been changed significantly since around 1995). All efforts to change this have been furiously resisted for decades, apparently.

At least, that is my understanding of the situation, but the issue has been discussed here and elsewhere on numerous occasions, and the consensus is that the national exam system governors see change as a bad thing, and refuse to acknowledge that anything is wrong with the curriculum.

https://www.quora.com/Why-is-Turbo-C++-still-being-used-in-Indian-Schools-and-Colleges

http://stackoverflow.com/questions/1961828/why-not-to-use-turbo-c

https://www.quora.com/Why-should-we-not-use-Turbo-C++

http://www.roseindia.net/programming/tutorials/C++Tutorials.shtml

Edited 9 Months Ago by Schol-R-LEA: added links to other conversations

sorry guys, i dont know how to convert this into C
i know how to do it in C++ but i cant make a program in C (i know i suck)

#include <iostream>

using namespace std;

main() {
    int list=0,pass=0,fail=0, grades[10];

     cout << "\n\t\tPASS AND FAILED GRADES COUNTER";
     cout << "\n\t Created By: Mr. Jake R. Pomperada,MAED-IT";
     cout << "\n\n";
    for (list=0; list < 10; list++) {
        cout << "Enter Grade No " << list+1 <<  " :" ;
        cin >> list[grades];
    }

        for (list=0; list < 10; list++) {

      if (list[grades] >= 75) {

         pass++;

     }

     else {
         fail++;
       }
    }

// display pass grades and failed grades
  cout << "\n";
  cout << "\n==============================";
  cout << "\n====== Generated Report ======";
  cout << "\n==============================";
  cout << "\n";
  cout << "Passed Grades => ";

        for (list=0; list < 10; list++)

        {

      if (list[grades] >= 75) {

      cout << " " <<  list[grades] << " ";
     }

    }
 cout << "\n";

cout << "Failed Grades => ";5

        for (list=0; list < 10; list++)
        {

      if (list[grades] < 75) {

      cout << " " <<  list[grades] << " ";
     }

    }

    cout << "\n";
    cout << "\nNumber of Passed Grades => " << pass << ".";
    cout << "\nNumber of Failed Grades => " << fail << ".";
    cout << "\n\n";
    system("pause");
}
  // End of Code

Instead of iostream use stdio.h

instead of cout << "text " << some_int << endl; // use printf( "text %d\n", some_int );

and do a web search on C printf to see how to print other types

remember to declare all your variables at the top of any new block

{
   int a, b; /* declare here if using C90 compiler standard */
   /* use this for all C90 standard comments  ... NOT //   */
}

and ... you do not use ...

  /* using namespace std; // NOT in C */

Edited 9 Months Ago by David W

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