🔒 Closed Basic programming using c++ ----- 05 loops

Status
Not open for further replies.

fazz12

Honorary Poster
While Loop
- eto yung loop na hangga't valid yung nasa condition nya, gagawin nya pa rin yung loop

int x=0;

while(x<5)
{
cout<<x;
x++;
}//once naging 5 na ang value ng x, hindi na nya ieexecute yung mga nasa loob ng { at }

Do..While loop
-gagawin nya ng isang beses yung nasa loob ng { at } bago nya tignan kung dapat pa ba nyang ulitin yung loop

int y=0;
do
{
cout<<"naexecute ako once";
}
while(y<5);

For Loop
eto naman almost same din ng nasa while, except automatic nya lang iniincrement/decrement yung nasa condition nya


int c=0;
for (c=0;c<100;c++)
{
cout<<c<<" "; //iaoutput nya to mula 0 to 99
}


sorry guys di ko na nasundan yung past tuts na ginawa ko. almost 3 years na rin. naging busy na kasi.
eto pala yung last topic na sinundan nito in case gusto nyo makita.
https://phcorner.org/threads/94638/
if ever di na to masundan baka tumulong na lang ako thru replies sa mga post ng mga nagpapatulong sa programming. Thank you.
 
Status
Not open for further replies.

About this Thread

  • 1
    Replies
  • 645
    Views
  • 2
    Participants
Last reply from:
verty32

Trending Topics

Online now

Members online
1,175
Guests online
4,463
Total visitors
5,638

Forum statistics

Threads
2,293,125
Posts
29,081,755
Members
1,208,669
Latest member
Lucky31
Back
Top