1 . menentukan tahun kabisat. .
nih flowchartnya. . .
nih dalam Dev C++
#include <iostream>
#include <string>
using namespace std;
class tahun{
friend istream& operator>>(istream& , tahun&);
friend ostream& operator<<(ostream& , tahun&);
public:
void input();
void output();
private:
int t;
float tahun;
};
istream& operator>>(istream& tahun_berapa , tahun& x){
cout <<"masukkan tahun" << endl;
tahun_berapa>> x.t;
}
ostream& operator<<(ostream& cout, tahun& x){
if (x.t % 4==0){
cout << "Tahun Kabisat" << endl; }
else{
cout << "Bukan Tahun Kabisat" << endl;
}
}
int main(){
tahun t;
cin>>t;
cout<<t;
system ("PAUSE");
return 0;
}
nih flowchartnya. . .
nih dalam Dev C++
#include <iostream>
#include <string>
using namespace std;
class tahun{
friend istream& operator>>(istream& , tahun&);
friend ostream& operator<<(ostream& , tahun&);
public:
void input();
void output();
private:
int t;
float tahun;
};
istream& operator>>(istream& tahun_berapa , tahun& x){
cout <<"masukkan tahun" << endl;
tahun_berapa>> x.t;
}
ostream& operator<<(ostream& cout, tahun& x){
if (x.t % 4==0){
cout << "Tahun Kabisat" << endl; }
else{
cout << "Bukan Tahun Kabisat" << endl;
}
}
int main(){
tahun t;
cin>>t;
cout<<t;
system ("PAUSE");
return 0;
}
0 komentar:
Posting Komentar