Blogger Widgets

How 2 print this out put in c++ by usin nested loop and for?


1
1 2 3
1 2 3 2 1
1 2 3
1

 Answers:
==========================================================

 #include <iostream>
using namespace std;
int main()
{

//    for Printing
//    1
//    1 2 3

for(int a= 0;a<=5;a+=2)
{
for(int b=1;b<a;b++){
cout<<b<<" ";
}
cout<<endl;
}

//for Printind 1 2 3 2 1

{
for(int d=1;d<=3;d++){
cout<<d<<" ";
}
for(int e=2;e>0;e--){
cout<<e<<" ";
}
cout<<endl;
}

// For printing 1 2 3
//              1

for(int f=3;f>=1;f-=2)
{
for(int g=1;g<=f;g++){
cout<<g<<" ";
}
cout<<endl;
}

// Hope This helpz

}
=======================================
For More Help Post Your Comments Below:
=======================================


2 comments:

  1. Contact Yahoo Email Customer Care Service Support Phone Number (UK)0800-014-8929
    yahoo help

    ReplyDelete
  2. Yahoo Email Customer Care Service Support Phone Number.
    0800-014-8929
    yahoo mail help
    yahoo help

    ReplyDelete