2 Wite Program Produces Following Output Using Nested Tor Loops Oop S Iv V Iv V Vv Q37280321

2., Wite a program that produces the following output using nested tor loops oop S: [A시 [A시 Iv v Iv v Vv

2., Wite a program that produces the following output using nested tor loops oop S: [A시 [A시 Iv v Iv v Vv Show transcribed image text 2., Wite a program that produces the following output using nested tor loops oop S: [A시 [A시 Iv v Iv v Vv


Answer


//C++ program

#include<iostream>
using namespace std;

int main(){
   int n=3;
  
   cout<<“+”;
   for(int i=0;i<2*n;i++)cout<<“-“;
   cout<<“+n”;
  
   for(int i=1;i<=n;i++){
       cout<<“|”;
       for(intj=0;j<n-i;j++)cout<<” “;
       cout<<“^”;
       for(intj=0;j<2*(i-1);j++)cout<<” “;
       cout<<“^”;
  

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.