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 container class? What are the types of container classes in c++?
Do you know what are pure virtual functions?
What are arithmetic operators?
When is dynamic checking necessary?
How long will it take to learn programming?
What is heap sort in c++?
Explain data encapsulation?
What is the disadvantage of using a macro?
What data encapsulation is in c++?
Write a program that takes a 5 digit number and calculates 2 power that number and prints it.
What is the full form of c++?
Can you pass a vector to a function?
What is using namespace std in c++?
What is #include iostream h in c++?
Write a Program to find the largest of 4 no using macros.