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
Is it possible to have a recursive inline function in c++?
What is meaning of in c++?
Explain the use of this pointer?
What is enum c++?
What is ios :: in in c++?
What is a Default constructor?
What is constant in c++ with example?
What should main() return in c and c++?
What is the need of a destructor?
How can you link a c program with a c function?
What is the difference between delegation and implemented-in-terms-of?
When there is a global variable and local variable with the same name, how will you access the global variable?
What is the meaning of c++?
What are arrays c++?
Can there be at least some solution to determine the number of arguments passed to a variable argument list function?