🔒 Closed Help! Nested loop

Status
Not open for further replies.

vien3211

Honorary Poster
Hello pwede po patulong dito? Salamat!
m_5wcmUPq5t5KPeoulZ94aauG2__pqCOqrtckQdLdv9uqspn58.webp

c++ po language
 
C++:
#include <iostream>

using namespace std;

int main() {
 int a, b, c;
    for(a=1;a<=20;a++){
        cout<<a<<" ";
        b=a%5;
        c=a;
        while(c<10){
            cout<<" ";
            c=10;
        }
        while(b==0){
            cout<<endl;
            b=1;
        }
    }
    return 0;
}
 

Attachments

  • 1638450765108.webp
    1638450765108.webp
    26.7 KB · Views: 22
Hello sir
C++:
#include <iostream>

using namespace std;

int main() {
 int a, b, c;
    for(a=1;a<=20;a++){
        cout<<a<<" ";
        b=a%5;
        c=a;
        while(c<10){
            cout<<" ";
            c=10;
        }
        while(b==0){
            cout<<endl;
            b=1;
        }
    }
    return 0;
}
Hello sir! Salamat po, gumana!
 
C++:
#include <iostream>
using namespace std;

int main(){
    int counter=0;
    for(int i=1;i<=4;i++){
        for(int j=1;j<=5;j++){
            counter++;
            cout<<counter<<"\t";
        }
        cout<<endl;
    }
    return 0;
}
 
Status
Not open for further replies.

About this Thread

  • 7
    Replies
  • 629
    Views
  • 4
    Participants
Last reply from:
FoXOnE23

Trending Topics

Online now

Members online
1,032
Guests online
1,224
Total visitors
2,256

Forum statistics

Threads
2,274,059
Posts
28,953,407
Members
1,235,039
Latest member
Drifter007
Back
Top