Breaking News
Loading...
Sabtu, 19 Maret 2016

Menampilkan Bilangan ganjil 1-100

Menampilkan Bilangan ganjil 1-100 dengan Dev C++ :


#include <iostream>
//#include <iostream.h>
#include <conio.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
int main(int argc, char** argv) {

int a,b,i;
a=-1;
   cout<<"     Bilangan ganjil (1_100) adalah: "<<endl;

   for (i=1;i<=50;i++)
   {

   b=2+a;

   cout<<b<<" "<<endl;
   a=b;
   }
getch ();
}  

Hasil Compile-nya :
Selamat Mencoba :)

0 komentar:

Posting Komentar

Copyright © 2014 My Blog My Adventure All Right Reserved