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
How can you quickly find the number of elements stored in a static array? Why is it difficult to store linked list in an array?
What is stl containers in c++?
What jobs can you get with a c++ certification?
What does it mean to declare a destructor as static?
You want to link a c++ program to c functions. How would you do it?
Is c++ a high level language?
What is a v-table?
What is the difference between delegation and implemented-in-terms-of?
Explain all the C++ concepts using examples.
how can i access a direct (absolute, not the offset) memory
address?
here is what i tried:
wrote a program that ask's for an address from the user,
creates a FAR pointer to that adress and shows it. then the
user can increment/decrement the value in that address by
pressing p(inc+) and m(dec-).
NOW, i compiled that program and opened it twice (in 2
different windows) and gave twice the same address to it.
now look what happen - if i change the value in
one "window" of the program, it DOES NOT change in the
other! even if they point to the same address in the memory!
here is the code snippet:
//------------------------------------------------------
#include What are libraries in c++? How would you use the functions sin(), pow(), sqrt()? Why was c++ made? What is abstraction in c++? In int main(int argc, char *argv[]) what is argv[0]
a) The first argument passed into the program
b) The program name
c) You can't define main like that