hi avery one i need this help ?

i want to do
a program to read ome nubers from the file and print only the negative odd nubers in another file ???

Member Avatar
#include <fstream>
using namespace std;

int main()
   ifstream fin;
   if (fin.fail())
      return 1;

   ofstream fout;
   if (fout.fail())
      return 1;

   int currentNumber;
   while (!fin.eof())
      fin >> currentNumber;
      if (currentNumber % 2 != 0 && currentNumber < 0)
         fout << currentNumber;


   return 0;

There's kind of what you want. I just wrote it without testing, so apologies in advance if there are errors.

commented: would you mind me sending you my homework? +0
commented: We don NOT do homework for people. We are an anti-cheating board. We do, however, GUIDE people to finding their own answers. -3