answersLogoWhite

0

#include <stdio.h>

int main() {

int rows, star, spaces;

int number_of_stars = 6;

int number_of_rows = number_of_stars;

for (rows=1; rows <= number_of_rows; rows++) {

for (spaces=1; spaces <= number_of_stars; spaces++) {

printf(" ");

}

for (star=1; star <= rows; star++) {

printf("*");

printf(" ");

}

printf("\n");

number_of_stars = number_of_stars - 1;

}

return 0;

}

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

How do you exit in nested loop in java?

You may exit a nested loop in Java using a break with a label for the outer loop.


What is computing in science?

Nesting is the process of organizing information in layers. For an example, a loop in a program can contain another loop which can contain yet another loop. This is called nested loops.


In C which loop is embedded within another loop?

The nested loop.


What is nesting in computer science?

Nesting is the process of organizing information in layers. For an example, a loop in a program can contain another loop which can contain yet another loop. This is called nested loops.


What is a nested loop in java?

A nested loop is a (inner) loop that appears in the loop body of another (outer) loop. The inner or outer loop can be any type: while, do while, or for. For example, the inner loop can be a while loop while an outer loop can be a for loop.


How do you use nested for loop on the image in matlab?

Please ask clearly what you want to do with the image and explain why a nested for-loop is necessary.


What is the definition of 'nested' in C programming?

In C a structure within a structure is called nested. For example, you can embed a while loop in another while loop or for loop in a for loop or an if statement in another if statement.


For loop program turbo c making a right triangle?

yes


What is the time complexity of a nested while loop?

The time complexity of a nested while loop is O(n2), where n represents the size of the input data. This means that the execution time of the nested while loop increases quadratically as the input size grows.


Write a program in Java which will print all nested loop between 1 to 500?

Sure! Here's a Java program that will print all the nested loops between 1 to 500: public class NestedLoopExample { public static void main(String[] args) { for (int i = 1; i &lt;= 500; i++) { for (int j = 1; j &lt;= 500; j++) { System.out.println(&quot;i=&quot; + i + &quot;, j=&quot; + j); } } } } This program uses two nested for loops to iterate from 1 to 500. It prints the value of i and j for each iteration of the loops.


Which loop is used when two things are done at the same time?

A loop inside a loop, which is known as a nested loop.


Write a program that input a positive integer and prints a triangle using for loop?

write a program that reads in the size of the side of square and then pints a hollow square of that size out of asterisks and blanks?