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 / gayatri chhotray

#include<iostream>
using namespace std;
int main()
{
int i;
int j;
int n = 118;
char c;
for(i = 1; i <= 5; i++)
{
for(j = 122; j >= n +(i-1); j--)
{
c = j;
cout<<c<<" ";
}
for(j=j+2; j<=122; j++)
{
c = j;
cout<<c<<" ";
}
cout<<endl;
}
return 0;
}

Is This Answer Correct ?    5 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the difference between overloading and overriding?

616


How a macro differs from a template?

637


How would you use the functions memcpy(), memset(), memmove()?

624


What is namespace & why it is used in c++?

610


What does the following do: for(;;) ; a) Illegal b) Loops forever c) Ignored by compiler...not illegal

704






Why do we need c++?

599


What are the restrictions apply to constructors and destructors?

645


Which is most difficult programming language?

582


How do I tokenize a string in c++?

610


What are the differences between malloc() and calloc()?

615


Explain friend class?

634


How to declare an array of pointers to integer?

586


Is c++ an integer?

579


Is it possible to provide special behavior for one instance of a template but not for other instances?

635


Is c++ a pure oop language?

602