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 virtual function? Explain with an example
How to declare a function pointer?
What is enum class in c++?
Which programming language's unsatisfactory performance led to the discovery of c++?
describe private access specifiers?
an integer constant must have atleast one a) character b) digit c) decimal point
Explain what is class definition in c++ ?
What is an iterator class in c++?
What do you mean by late binding?
Explain the purpose of the keyword volatile.
What can c++ be used for?
How the endl and setw manipulator works?
What is recursion?
What is a storage class?
Write an algorithm that determines whether or not an almost complete binary tree is a heap.