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's the order in which the local objects are destructed?
Explain unexpected() function?
what is upcasting in C++?
What is the difference between mutex and binary semaphore?
What is public, protected, private in c++?
What does std mean in c++?
What are the differences between malloc() and calloc()?
List down the guideline that should be followed while using friend function.
Can java be faster than c++?
What is c++ code?
What is the difference between a "copy constructor" and an "assignment operator" in C++?
When does a 'this' pointer get created?
Which sort does c++ use?
How important is c++?
What is token c++?