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 / naman patidar

#include <iostream.h>

int main(){
char start ='z';
char end ='v';
int limit = start-end+1;

for(int i=0; i<limit; i++){
char ch = start+1;

for(int j=0; j<limit; j++){
if( j>=i ){
cout<<--ch<<"\t";
} else {
cout<<"\t";
}
}
for(int k=limit-1; k>i ; k--){
cout<<++ch<<"\t";
}
cout<<"\n\n";
}
return 0;
}

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the advantages of using const reference arguments in a function?

844


What are static member functions?

817


Is c++ a good first language to learn?

764


Explain what are single and multiple inheritances in c++?

741


Is c++ platform dependent?

839


What are advantages of c++?

779


What is the difference between while and do while loop?

836


Why cout is used in c++?

765


State two differences between C and C++.

812


What is stack unwinding?

804


How do I get good at c++ programming?

841


What is a base class?

807


what kind of projects are suitable for c and c++

820


What is an inline function in c++?

855


Evaluate !(1&&1||1&&0) a) Error b) False c) True

951