About 79,900 results
Open links in new tab
  1. c - how to arrange asterisks in triangle - Stack Overflow

    Jun 26, 2017 · With a little preparation, you could output the spaces and stars in a single printf() statement. If you study the (POSIX) specification for printf() carefully and do a little preparation work, you'll find that you can print each line with a single call to printf().

  2. java - The triangle made of asterisks - Stack Overflow

    Feb 16, 2015 · I have to make a triangle made of asterisk for a homework. The number of rows wille be determined by which integer the user inputs and show give something like this. I'm not really sure how to do this. But this is what I have so far (pretty sure I made dumb errors) public static void main(String args[]) { /*declarations*/

  3. Asterisks Triangle in Python - Stack Overflow

    Nov 6, 2012 · I am trying to create a program that allows me to make a "pyramid" or "triangle" using asterisks, in the Python program. I've already started the code, but can't seem to figure it out. Here's the code I've managed to figure out: def triangle(): totalRows = int(eval(input("How big? "))) for currentRows in range(1,totalRows+1):

  4. C : Display the pattern like right angle using an asterisk - w3resource

    Mar 18, 2025 · Write a program in C to display a pattern like a right angle triangle using an asterisk. This C program generates a right-angle triangle pattern using asterisks (*). The user specifies the number of rows for the triangle, and the program uses nested loops to …

  5. C++ Triangle Pattern with Asterisks - CodePal

    This C++ code snippet demonstrates how to print a triangle pattern using asterisks. The program uses loops to iterate through the rows and columns of the triangle and prints the appropriate number of spaces and asterisks to form the desired shape.

  6. Printing Asterisks Triangle Shapes in Java - java problems

    All asterisks (*) should be printed by a single statement of the form System.out.print( '*' ); which causes the asterisks to print side by side. A statement of the form System.out.println(); can be used to move to the next line.

  7. How to Print Asterisk Triangle Pyramid in Java - Quick Programming

    Printing asterisk triangle is common programming problem given to beginners learning Java language. This will help students to grasp the power of loop programming construct. There are a number of variants of this problem. The following example shows how a triangle pyramid can be printed using Java.

  8. C Function: Print Triangle of Asterisks - CodePal

    This function is designed to print a triangle of asterisks with a given height in C programming language. The function takes an integer parameter that represents the height of the triangle. The triangle is printed using nested loops that iterate over each row and column of the triangle.

  9. ascii art - Asterisk triangle in python - Stack Overflow

    Mar 22, 2013 · def asterisk_triangle(n): """ takes an integer n and then returns an asterisk triangle consisting of (n) many lines """ x = 1 while (x <= n): print("*" * x) x = x + 1 return And also I had to create an upside down asterisk triangle by manipulating the first function.

  10. A simple program that prints a pattern of asterisks (*)

    Oct 19, 2023 · This C++ program is a simple example of a program that prints a pattern of asterisks (*) in the shape of a right-angled triangle. It does this based on the number of rows you input.

  11. Some results have been removed
Refresh