write a program in c++ to generate imp

z y x w v w x y z
z y x w x y z
z y x y z
z y z
z

Answer Posted / gayatri chhotray

#include<iostream>
using namespace std;
int main()
{
int i;
int j;
int n = 118;
char c;
for(i = 1; i <= 5; i++)
{
for(j = 122; j >= n +(i-1); j--)
{
c = j;
cout<<c<<" ";
}
for(j=j+2; j<=122; j++)
{
c = j;
cout<<c<<" ";
}
}
return 0;
}

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Are c and c++ different?

657


Can union be self referenced?

726


What is constant in c++ with example?

759


What can I use instead of namespace std?

784


What are the advantages of using friend classes?

763






What is the basic difference between C and C++?

744


What is the difference between global variables and local variable

651


What is virtual function? Explain with an example

717


Why is c++ still best?

676


Is c++ a pure oop language?

736


What is the use of this pointer in c++?

707


Explain the different access specifiers for the class member in c++.

676


Explain the purpose of the keyword volatile.

766


what are the iterator and generic algorithms.

1624


Can we use this pointer in a class specific, operator-overloading function for new operator?

732