b374k
v10
today : Friday, March 14, 2025 | at : | safemode : ON
> / home / facebook / twitter / youtube /
name author perms com modified label

show the even number ( iterative ) pramana rwxr-xr-x 0 11:56 am

Filename show the even number ( iterative )
Permission rw-r--r--
Author pramana
Date and Time 11:56 am
Label
Action
Hi guys....
Now, i'll give a program for show the even number from 25 till 70 with iterative...
This program just simple,just used the looping and selection....
So, please look this sourcode (c++) of this program....

#include <cstdlib>
#include <iostream>
using namespace std;
class genap{
      friend istream& operator>>(istream&, genap&);
      friend ostream& operator<<(ostream&, genap&);
      public:
             genap();
             void iteratif();
      private:
              int i,n;
      };
genap::genap(){cout<<endl;
               cout<<"\t\tShow the even number with iteratif from 25 till 70"<<endl<<endl;
               cout<<endl;
               }
ostream& operator<<(ostream& out, genap& keluar){ }
void genap::iteratif(){
     n=25;
     for(i=70;i>=n;i--){
                        if(i%2==0){cout<<i<<" , ";}
                        else{}
                        }
     cout<<endl<<endl;
     }
int main()
{
    genap siap;
    siap.iteratif();
    cout<<siap;
    cout<<endl;
    system("PAUSE");
    return 0;
}

if u have the questions, please visit me on here ^_^

0 comments:

Post a Comment

 

Jayalah Indonesiaku © 2010 Pramana's BLOG
VB (Vio b374k) Template design by p4r46hcyb3rn3t