write a program to print
*
* *
* * *

Answer Posted / nash

#include <iostream>
using namespace std;
int main()
{
int i, j, k, m = 10, n;
for (i=0; i<=10; i++){
// Insert one loop to cal culate space to
be kept at start point
for (j=1; j<=m; j++){
cout << " ";
}
for (k=0; k<=i; k++){
cout << " *"; // put here "space
*" so all aligns properly like star

}
cout << '\n';
m--;
}
cin >> n;
return 0;
}

Is This Answer Correct ?    7 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are objects in oop?

821


Who invented oop?

833


Hi friends I have experience of 6 months in website design and maintanence. Now i am looking for other IT jobs.. to switch platform. please post any interview you know in chennai.

1958


How can you overcome the diamond problem in inheritance?

955


Write a java applet that computes and displays the squares of values between 25 and 1 inclusive and displays them in a TextArea box

2264


Can main method override?

826


What is the real life example of polymorphism?

841


Can a destructor be called directly?

796


class CTest { public: void someMethod() { int nCount = 0; cout << "This is some method --> " << nCount; } }; int main() { CTest *pctest; pctest->someMethod(); return 0; } It will executes the someMethod() and displays the value too. how is it possible with our creating memory for the class . i think iam not creating object for the class. Thanks in Advance... Prakash

1963


Advantage and disadvantage of routing in telecom sector

1011


Is abstract thinking intelligence?

777


What is a class and object?

784


What is polymorphism and its types?

799


What are oops functions?

777


What is the difference between static polymorphism and dynamic polymorphism?

839