Ahad, 20 Mac 2016

Kasus 4.2 (Mencetak bilangan ganjil dari 0 sampai 10)

Algoritma:








Program C++:

#include <iostream>

/* 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 i=1;
while
(i<=10)
{
if(i%2==1)
cout<<i<<endl;
i++;
}
return 0;

}

Raptor:

Load disqus comments

0 ulasan