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 / prasenjit roy

#include <iostream>
using namespace std;

#define START 'z'
#define END 'v'
#define LIMIT ( START - END + 1 )

int main(int argc, char* argv[])
{
int i,j;

for( i=0; i<LIMIT; i++){
char ch = START+1;

for( j=0; j<LIMIT; j++)
if( j>=i )
cout<<--ch<<" ";
else
cout<<" ";


for( j=LIMIT-1; j>i ; j--)
cout<<++ch<<" ";

cout<< endl;
}

return 0;
}

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is flag in computer?

734


Write about the various sections of the executable image?

690


How do you traverse a btree in backward in-order?

750


How many types of classes are there in c++?

721


What is implicit conversion/coercion in c++?

835






How do you write a function that can reverse a linked-list?

720


What is the purpose of extern storage specifier?

747


What is ios in c++?

800


What is the full name of logo?

737


What do you mean by inheritance in c++? Explain its types.

743


What are libraries in c++?

740


Is there structure in c++?

717


What is c++ library?

728


Explain what is polymorphism in c++?

774


Why do we need c++?

723