HN-Community
Looping iseng dengan For While Syntax - Printable Version

+- HN-Community (https://hacker-newbie.org)
+-- Forum: Miscellaneous (https://hacker-newbie.org/forum-86.html)
+--- Forum: Coding/Programing (https://hacker-newbie.org/forum-19.html)
+---- Forum: C & C++ (https://hacker-newbie.org/forum-77.html)
+---- Thread: Looping iseng dengan For While Syntax (/thread-14159.html)



Looping iseng dengan For While Syntax - RieqyNS13 - 06-13-2012

dri pada ane depes dan gak ngapa2in mending iseng2 ngoding c++ aja gan,,,,
Code:
//Author : RieqyNS13// //Program : coba sndiri // #include <iostream> #include <string> #include <iomanip> #include <windows.h> using namespace std; int main() { system("color 0A"); system("TITLE looping Mas bro"); unsigned long int loop, time, a=0, x; char set = ' '; cout<<"Input Looping = "; cin>>loop; cout<<"Input Interval = "; cin>>time; cout<<"Input Setfill Variabel = "; cin>>set; //Kalkulasi'_'// while(loop=loop-1) { int t=loop+1;; for(int a=1; a<=loop; a=a+1) { int c=a; c=c*2; t=t-1; cout<<setfill(' ')<<setw(t)<<" "<<setfill(set)<<setw(c)<<" "<<endl; Sleep(time); } x=loop; for(int b=1; b<=loop; b=b+1) { x=x-1; int z=b, v=x; v=v*2; z=z+1; cout<<setfill(' ')<<setw(z)<<" "<<setfill(set)<<setw(v)<<" "<<endl; Sleep(time); } } //////////////// system ("pause>nul"); return 0; }

setelah di compile (klo ane pke DevC++) hasilnya kaya gini gan,,
[Image: 2btfzo.png]
sorry klo cuma gitu doank


RE: Looping iseng dengan For While Syntax - UHD - 06-14-2012

mksud-na looping apa om ? Bingung maap, newbie emang banyak tany Kamsia


RE: Looping iseng dengan For While Syntax - RieqyNS13 - 06-14-2012

Looping itu perulangan om, jadi kalo perintahnya terpenuhi, maka akan kembali lagi sampai kriteria terpenuhi