🔒 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: 24
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
  • 657
    Views
  • 4
    Participants
Last reply from:
FoXOnE23

Trending Topics

Online now

Members online
636
Guests online
1,042
Total visitors
1,678

Forum statistics

Threads
2,287,419
Posts
29,044,583
Members
1,216,522
Latest member
mrshanks
Back
Top