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
What is the main use of c++?
When does a name clash occur in c++?
Explain 'this' pointer and what would happen if a pointer is deleted twice?
How would you obtain segment and offset addresses from a far address of a memory location?
What is the difference between the parameter to a template and the parameter to a function?
How is modularity introduced in C++?
Tell me what are static member functions?
Differences between private, protected and public and give examples.
What is this weird colon-member (" : ") syntax in the constructor?
What is function declaration in c++ with example?
What are friend classes? What are advantages of using friend classes?
What are c++ templates used for?
When is dynamic checking necessary?
Explain the static storage classes in c++.
How do you declare A pointer to function which receives an int pointer and returns a float pointer