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
What is flag in computer?
Write about the various sections of the executable image?
How do you traverse a btree in backward in-order?
How many types of classes are there in c++?
What is implicit conversion/coercion in c++?
How do you write a function that can reverse a linked-list?
What is the purpose of extern storage specifier?
What is ios in c++?
What is the full name of logo?
What do you mean by inheritance in c++? Explain its types.
What are libraries in c++?
Is there structure in c++?
What is c++ library?
Explain what is polymorphism in c++?
Why do we need c++?