#include
<iostream>
#include
<conio.h>
using
namespace std;
int
main()
{
int n, i;
cout << "Nama : Angelia
Saimin" << endl
<< "NIM : 13013061" << endl
<< "Kelas: TIR 2.1"
<< endl;
cout <<
"=================================================" << endl;
cout << " PROGRAM MENAMPILKAN
DERET BILANGAN GANJIL GENAP" << endl;
cout <<
"=================================================" << endl
<<endl;
cout << "Masukkan nilai ke n =
"; cin >> n;
cout << endl << endl;
cout << "bilangan" <<
endl;
for (i=0; i<=n; i++)
{
cout << i << " ,
";
}
cout << endl << endl;
cout << "Bilangan Ganjil"
<< endl;
for (i=0; i<=n; i++)
{
if(i%2!=0)
}
cout << endl << endl;
cout << "Bilangan Genap"
<< endl;
for (i=0; i<=n; i++)
{
if(i%2==0)
cout << i << " ,
";
}
getch();
}
0 komentar: