Program Perulangan For (C++)

Lagi belajar pemrograman C++ neh, baru bisa buat script2 seperti in
Program berikut menggunakan Turbo C++ 4.5

#include
main()
{
printf (" PROGRAM LOOPING For \n");
printf ("-------------------------------\n");
printf ("\n");

{
int baris=1;
int maks=6;
int kolom=1;
int hasil_kali;
for (baris=1; baris<=maks; baris++)
{
hasil_kali=kolom*baris+(baris-1);
printf("%2d \n",hasil_kali);
}
}

}


kalau di Run hasilnya :

PROGRAM LOOPING FOR
-----------------------------

1
3
5
9
7
11


Bagi yang sudah master mohon bimbingannya, saran dan kritik pastinya
Thanks

0 komentar:

 

Usage Rights

DesignBlog BloggerTheme comes under a Creative Commons License.This template is free of charge to create a personal blog.You can make changes to the templates to suit your needs.But You must keep the footer links Intact.