• RSS
  • Delicious
  • Digg
  • Facebook
  • Twitter
  • Linkedin
  • Heading 1 Here:Enter the heading 1 description here.Go to blogger edit html,find these words and replace it with your own description ...
  • Heading 2 Here:Enter the heading 2 description here.Go to blogger edit html,find these words and replace it with your own description ...
  • Heading 3 Here:Enter the heading 3 description here.Go to blogger edit html,find these words and replace it with your own description ...
  • Heading 4 Here:Enter the heading 4 description here.Go to blogger edit html,find these words and replace it with your own description ...
  • Heading 5 Here:Enter the heading 5 description here.Go to blogger edit html,find these words and replace it with your own description ...
  • SLIDE-1-TITLE-HERE

    Welcome to Blogger.Go to Blogger edit html and find these sentences.Now replace these text/sentences with your own descriptions.This theme is convert to Blogger by Premiumbloggertemplates.com.Download this template and more Premium Blogger Templates From PremiumBloggerTemplates.com...

  • SLIDE-2-TITLE-HERE

    Welcome to Blogger.Go to Blogger edit html and find these sentences.Now replace these text/sentences with your own descriptions.This theme is convert to Blogger by Premiumbloggertemplates.com.Download this template and more Premium Blogger Templates From PremiumBloggerTemplates.com...

  • SLIDE-3-TITLE-HERE

    Welcome to Blogger.Go to Blogger edit html and find these sentences.Now replace these text/sentences with your own descriptions.This theme is convert to Blogger by Premiumbloggertemplates.com.Download this template and more Premium Blogger Templates From PremiumBloggerTemplates.com...

  • SLIDE-4-TITLE-HERE

    Welcome to Blogger.Go to Blogger edit html and find these sentences.Now replace these text/sentences with your own descriptions.This theme is convert to Blogger by Premiumbloggertemplates.com.Download this template and more Premium Blogger Templates From PremiumBloggerTemplates.com...

Rabu, 13 April 2011

Program menentukan Tahun Kabisat

Posted by Cipto Tri Raharjo On 23.57 No comments

#include <iostream.h>
#include <string.h>
#include <conio.h>
class Kabisat{
private:
int l;
char tahun[4];
public:
Kabisat();
void hitungKabisat();
friend istream &operator >> (istream &in, Kabisat &);
friend ostream &operator << (ostream &out, Kabisat &);};
int main(){
Kabisat n;
cin >>n;
cout<<n;
system (“pause”);
return EXIT_SUCCESS;}
Kabisat::Kabisat(){
cout <<”Menentukan Tahun Kabisat”<< endl;}
void Kabisat::hitungKabisat(){
if ( l % 4 != 0)
strcpy(tahun,”Bukan Tahun kabisat”);
else
strcpy(tahun,”tahun kabisat”);}
istream &operator >> (istream &in, Kabisat &masukan){
cout<<”Lukman Reza Memasukan tahun : ” ;
in>>masukan.l;
return in;}
ostream &operator<<(ostream &out, Kabisat &tampil){
tampil.hitungKabisat();
out<<tampil.l<<”  “<<tampil.tahun<<endl;
return out;
}

Anda pasti tahu kan apa itu tahun kabisat...? tahun kabisat adalah tahun yang habis di bagi 4, tahun yang tidak habis di bagi 4 maka bukan tahun kabisat misalnya I sebagai tahun maka prosesnya  if ( l % 4 != 0).

0 komentar:

Posting Komentar