Menampilkan Bilangan Ganjil dan Genap

#include<iostream>
#include<conio.h>
using namespace std;

int main()
{
    int i;
    printf("\tMENAMPILKAN BILANGAN GANJIL DAN GENAP \n ");
    printf("=============================================\n ");
    printf("\tNAMA\t: A.B ARHAMMUDDIN\n ");
    printf("\tNIM\t: 2015141106\n ");
    printf("=============================================\n ");
    cout<<"\nGanjil : ";
    for(i=1;i<=35;i++)
    {
        if(i%2!=0)
        cout<<i<<" ";
    }
    cout<<endl<<endl<<"\nGenap : ";
    for(i=1;i<=35;i++)
    {
        if(i%2==0)
        cout<<i<<" ";
    }
    cout<<endl<<endl<<endl;
    getch();
}

Tugas Akhir Halaman 22 -> Tugas Akhir Pertemuan 4

Comments

Populer

Full Modul Kuliah "Teknik Informatika" Universitas Pamulang - UNPAM

Full Modul Kuliah "Teknik Informatika"

Implementasi Stack