C++ Meghitung deret bilangan
pada program menghitung deret bilangan ini anda bebas memasukkan nilai 10 maka yang akan tampil adalah 1+2+3......+10 begitupun bilangan lainnya. selamat mencoba semoga bermanfaat.
#include <iostream>
#include <stdio.h>
#include <conio.h>
using namespace std;
void deret()
{
int A,i,j,jum;
cout<<"\t\t++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
cout<<"\t\t PROGRAM MENGHITUNG DERET BILANGAN "<<endl;
cout<<"\t\t++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
cout<<"Input Deret : ";
cin>>A;
for(i=1;i<=A;i+=2)
{
jum=1;
for(j=1;j<=A;j+=1)
{
if(j!=1)
cout<<"+";
cout<<j;
jum+=j;
}
cout<<"="<<jum<<endl;
}
cout<<endl;
getch();
}
main()
{
deret();
#include <iostream>
#include <stdio.h>
#include <conio.h>
using namespace std;
void deret()
{
int A,i,j,jum;
cout<<"\t\t++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
cout<<"\t\t PROGRAM MENGHITUNG DERET BILANGAN "<<endl;
cout<<"\t\t++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
cout<<"Input Deret : ";
cin>>A;
for(i=1;i<=A;i+=2)
{
jum=1;
for(j=1;j<=A;j+=1)
{
if(j!=1)
cout<<"+";
cout<<j;
jum+=j;
}
cout<<"="<<jum<<endl;
}
cout<<endl;
getch();
}
main()
{
deret();
}
#include <stdio.h>
#include <conio.h>
using namespace std;
void deret()
{
int A,i,j,jum;
cout<<"\t\t++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
cout<<"\t\t PROGRAM MENGHITUNG DERET BILANGAN "<<endl;
cout<<"\t\t++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
cout<<"Input Deret : ";
cin>>A;
for(i=1;i<=A;i+=2)
{
jum=1;
for(j=1;j<=A;j+=1)
{
if(j!=1)
cout<<"+";
cout<<j;
jum+=j;
}
cout<<"="<<jum<<endl;
}
cout<<endl;
getch();
}
main()
{
deret();
#include <iostream>
#include <stdio.h>
#include <conio.h>
using namespace std;
void deret()
{
int A,i,j,jum;
cout<<"\t\t++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
cout<<"\t\t PROGRAM MENGHITUNG DERET BILANGAN "<<endl;
cout<<"\t\t++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
cout<<"Input Deret : ";
cin>>A;
for(i=1;i<=A;i+=2)
{
jum=1;
for(j=1;j<=A;j+=1)
{
if(j!=1)
cout<<"+";
cout<<j;
jum+=j;
}
cout<<"="<<jum<<endl;
}
cout<<endl;
getch();
}
main()
{
deret();
}