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

How long to learn object oriented programming?

553


What is polymorphism oop?

610


What is debug class?what is trace class? What differences are between them? With examples.

1596


Why is object oriented programming so hard?

605


Can a varargs method be overloaded?

611






write a programe to calculate the simple intrest and compund intrest using by function overlading

1653


What is a class oop?

584


how to get the oracle certification? send me the answer

1654


Can an interface inherit a class?

549


This program numbers the lines found in a text file. Write a program that reads text from a file and outputs each line preceded by a line number. Print the line number right-adjusted in a field of 3 spaces. Follow the line number with a colon, then one space, then the text of the line. You should get a character at a time and write code to ignore leading blanks on each line. You may assume that the lines are short enough to fit within a line on the screen. Otherwise, allow default printer or screen output behavior if the line is too long (i.e., wrap or truncate). A somewhat harder version determines the number of spaces needed in the field for the line numbers by counting lines before processing the lines of the file. This version of the program should insert a new line after the last complete word that will fit within a 72-character line.

1628


What is polymorphism and example?

581


What are benefits of oop?

623


If a=5, b=6, c=7, b+=a%c*2. What is the final value of b?

932


what are the ways in which a constructors can be called?

1568


What is the difference between a constructor and a destructor?

598