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 is the main use of c++?

698


When does a name clash occur in c++?

836


Explain 'this' pointer and what would happen if a pointer is deleted twice?

733


How would you obtain segment and offset addresses from a far address of a memory location?

730


What is the difference between the parameter to a template and the parameter to a function?

788






How is modularity introduced in C++?

877


Tell me what are static member functions?

721


Differences between private, protected and public and give examples.

692


What is this weird colon-member (" : ") syntax in the constructor?

662


What is function declaration in c++ with example?

654


What are friend classes? What are advantages of using friend classes?

733


What are c++ templates used for?

767


When is dynamic checking necessary?

711


Explain the static storage classes in c++.

833


How do you declare A pointer to function which receives an int pointer and returns a float pointer

811