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 a wchar_t in c++?
What is the use of string in c++?
Which software is used for c++ programming?
What do you mean by function pointer?
What are the types of array in c++?
Is there any function that can skip certain number of characters present in the input stream?
Which software is best for c++ programming?
Can malloc be used in c++?
What is setf in c++?
Is there a sort function in c++?
What is the best way to declare and define global variables?
What is a dynamic binding in c++?
Difference between an inspector and a mutator
Explain the static member function.
What is a string example?