Filename | show the even number ( iterative ) |
Permission | rw-r--r-- |
Author | pramana |
Date and Time | 11:56 am |
Label | Alpro cases |
Action |
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