answersLogoWhite

0


Best Answer

#include <stdio.h>

int main (void)

{

int i,j;

for (i=1;i<5;i++)

{

for(j=1;j<=i;j++)

printf("%d",j);

printf("\n");

}

return 0;

}

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a program of displaying numbers in shape of triangles by using looping?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Ascending order program for java?

public class BubbleSortAscendingOrderDemo { public static void main(String a[]) { //Numbers which need to be sorted int numbers[] = {23,5,23,1,7,12,3,34,0}; //Displaying the numbers before sorting System.out.print("Before sorting, numbers are "); for(int i = 0; i &lt; numbers.length; i++) { System.out.print(numbers[i]+" "); } System.out.println(); //Sorting in ascending order using bubble sort bubbleSortInAscendingOrder(numbers); //Displaying the numbers after sorting System.out.print("Before sorting, numbers are "); for(int i = 0; i &lt; numbers.length; i++) { System.out.print(numbers[i]+" "); } }


What is the difference between Do While statements and Do For statements?

A "do while....." statement is a looping instruction to a program to repeat a stage in the program while some condition is true - e.g while a variable is negative, or, while one variable is less than another. A "do for ....." statement is a looping instruction to a program to repeat a stage in the program a set number of times - e.g for steps = 1 to 10, or, for steps = 1 to (some variable).


What is a filtering program that stops pop ups from displaying on webpages?

Pop-up blocker


How do you make a program like 5142332415 using looping?

There is insufficient information in the question to answer it. Please rephrase the question.


Which program has red background and three triangles in its logo?

FlashGet Download Manager


A computer programmer wrote a program that adds two numbers The programmer ran the program and observed that when 5 is added to 8 the result is the character m Explain why this program is behaving?

This is happening because when the programmer is displaying the number, it is being displayed as a character with a decoding process of a = 1, b = 2, etc. 5 + 8 = 13 = m


How do you do a program looping?

An infinite loop might look something like: while 1==1: print("Infinite loop") as 1 is ALWAYS equal to 1.


1 equals n how to find answer n equals 100?

You cannot, unless n is a counter in a program or algorithm for a looping process. In that case, you need to know what the algorithm is doing.


C program for displaying perfect numbers using nested loop?

for (n=1; n&lt;1000; ++n) { for (sum=0, k=1; k&lt;=n/2; ++k) if (n%k==0) sum += k; if (sum==n) printf ("%d\n", n); }


Program to count the number of numbers in an array using 8085 microprocessor?

A program which is used to count the number of numbers in an array using a 8085 microprocessor is known as a assembly language program.


How to write a C program to find largest 2 numbers using pointers?

program to find maximum of two numbers using pointers


Algorithm and flow chart of the program for ascending and descending order of numbers?

Use a looping structure. The first step initialises a loop control variable, n, to zero. You then begin the loop by processing the nth element from the array (the process may be a simple print statement). You then increment n. Finally, you test the value of n; if it is less than 10 you start a new iteration of the loop, otherwise you proceed to the end of the flowchart.