Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8845285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T11:42:06+00:00 2026-06-14T11:42:06+00:00

So I need to come up with something like this: It’s a layout of

  • 0

So I need to come up with something like this: It’s a layout of seats on an airplane.

1 A B C D

2 A B C D

3 A B C D

4 A B C D

5 A B C D

6 A B C D

7 A B C D

But instead my code prints this:

ABCD

ABCABCD

ABCABCD

ABCABCD

ABC

This is my code, any help would be really appreciated. I just started working with arrays

#include <iostream>

using namespace std;

int main ()
{
     char airplane[7][4] = {{'A', 'B', 'C', 'D'},
                             {'A', 'B', 'C', 'D'},
                             {'A', 'B', 'C', 'D'},
                             {'A', 'B', 'C', 'D'},
                             {'A', 'B', 'C', 'D'},
                             {'A', 'B', 'C', 'D'},
                             {'A', 'B', 'C', 'D'}};

     for (int i=0; i<4; i++)
     {

            for (int j=0; j<7; j++)
            {
                 cout<<airplane[i][j];
                 if (airplane[i][j]=='D')
                 {
                     cout<<endl;
                 }
            }
     }

     system ("PAUSE");
     return 0;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T11:42:07+00:00Added an answer on June 14, 2026 at 11:42 am

    Here the code :

     #include <iostream>
    
        using namespace std;
    
        int main ()
        {
             char airplane[7][4] = {{'A', 'B', 'C', 'D'},
                                     {'A', 'B', 'C', 'D'},
                                     {'A', 'B', 'C', 'D'},
                                     {'A', 'B', 'C', 'D'},
                                     {'A', 'B', 'C', 'D'},
                                     {'A', 'B', 'C', 'D'},
                                     {'A', 'B', 'C', 'D'}};
    
             for (int i=0; i<7; i++)
             {
                 cout << i+1;
                    for (int j=0; j<4; j++)
                    {
                         cout<<airplane[i][j];
                         if (airplane[i][j]=='D')
                         {
                             cout<<endl;
                         }
                    }
             }
    
             system ("PAUSE");
             return 0;
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Maybe this sounds a little bit crazy, but I need to come up with
I'm already tossing around a solution but as I haven't done something like this
I need something like a cookie, but I specifically don't want it going back
I feel really dumb not to be able to solve something like this, but
I come from a world of c# were doing something like this is allowed.
If I do something like this: byte[] buffer = new byte[1024]; Socket sock =
I have a few checkboxes representing people. Something like this: [ ] George [
This is something of a philosophical question, but one I hope to have answered
Is it possible to to something like this using Spring.NET IoC container? MyClass instance
I have a data-structure (in plist) that looks something like this: What i have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.