🔒 Closed Hi can someone help me about this po . C++ po language for loop

Status
Not open for further replies.

Elecit23

Eternal Poster
1642077826843.webp



Hindi po ito assignment or quiz this is just a practice po na binigay sa amin ng prof namin I hope someone will help about this na code ko na yung kabilang phase na triangle yung space lang tsaka yung nasa right na triangle lang di ko alam paano gawin. TYIA <3

already solved thanks nalang <3
 
interested ako sa it ts, mahirap po ba talaga? wala pa po akong knowledge pagdating sa coding. any tips?
 
C:
void main(){
    
    int space =1 , atPatternCount = 0 , a, enterNum ;
    printf("Enter the Number (1 - 10): ");
       scanf("%i", &enterNum);

    atPatternCount = enterNum;

       for (a = 0; a < enterNum; a++)
       {
           for (int i = 0; i < 2; i++)
           {
               for (int j = 0; j < atPatternCount; j++)
                {
                    printf("@");
                }
                if(i != 1){
                    for (int h = 0; h < space; h++)
                    {
                        printf(" ");
                    }
                }
                
           }
           space+=2;
           atPatternCount--;
          
           printf("\n");
       }
      
}
 
Status
Not open for further replies.

About this Thread

  • 9
    Replies
  • 822
    Views
  • 5
    Participants
Last reply from:
Elecit23

Trending Topics

Online now

Members online
1,237
Guests online
1,126
Total visitors
2,363

Forum statistics

Threads
2,287,308
Posts
29,043,717
Members
1,216,456
Latest member
Hesham2012
Back
Top