Scoring algorithm number is divisible by 5 and 7 between 1 to 100 iterative

Here is the scoring algorithm number is divisible by 5 and 7 between 1 to 100 iteratively using the RAPTOR and C + +:

Image

These use the c + + :

#include
#include
using namespace std;
int main()
{
   int limit;
   int i;
   i =1;
   limit =101;
   while (!(i==limit))
   {
      if (i % 5==0 && i % 7==0)
      {
         cout << i << endl;      }
      else
      {
      }
      i =i+1;
   }
   system(“PAUSE”);
   return 0;
}

These use the c + + (class structure)

#include
#include
 
using namespace std;
 
class number{
      friend ostream& operator<<(ostream&, number&);
      friend istream& operator>>(istream&, nymber&);
 
      public:
      number(){};
     
 
      void proses(){
             i =1;
   limit =101;
   while (!(i==limit))
   {
      if (i % 5==0 && i % 7==0)
      {
         cout << i << endl;      }
      else
      {
      }
      i =i+1;
   }
 
             }
            
      private:
   int limit;
   int i;

};
 
istream& operator>>(istream& in, number& enter){
    cout<<“Enter Number : “<<endl;
    in  >>enter.i;
 
    return in;
}
 
ostream& operator<<(ostream& out, number& output){
    cout<<“Output  : “<<endl;
   
    return out;
}
 
int main(int argc, char *argv[])
{
    digit numbers;
    cin >> rate;
    rate.proses();
    cout<<rate;
    cout<< endl;
 
    system(“PAUSE”);
    return 0;
}


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s