Write a program in the C programming language to print the triangle of numbers. Make a C program to print the following right angled triangle-
1
12
123
1234
12345
123456
1234567
12345678
123456789
Make this program by using the nested for loop. Below is the solution of the program.-
void main() { int n, i; for(i=1 ;i<=9; i++) { for(n=1; n<=i; n++) { printf("%d",n); } printf("\n"); } getch(); }
Output – Output of the program will be same as the triangle made above.
1
2 3 4
5 6 7 8 9
#include
main()
{
int i,j,k,n;
printf(“Enter number of rows of the triangle \n”);
scanf(“%d”,&n);
for(i=1;i<=n;i++)
{
for(k=1;k<=(2*i)-1;k++)
{
j=i;
printf("%d",j);
j++;
}
printf("\n");
}
getch();
}
#include
int main()
{
int n, i, c, a = 1;
printf(“Enter the number of rows of Floyd’s triangle to print\n”);
scanf(“%d”, &n);
for (i = 1; i <= n; i++)
{
for (c = 1; c <= i; c++)
{
printf("%d ",a);
a++;
}
printf("\n");
}
return 0;
}
1
234
56789
_-1-_
_234_
56789
1
21
321
4321
54321
write a program using nested for loop to display
1
21
321
4321
54321
what the code of
1
21
321
4321
54321
i want program by output as 1 2 2 4 3 6 9
4 8 12
5 10 15
i want program by output as
1 2
2 4
3 6 9
4 8 12
5 10 15
please tell me how can i print these type of stars
*
* *
* * *
* *
*
How to print thise
1
1 3
1 3 5
1 3 5 7
1 3 5
1 3
1
I want the program of output
1) *
**
***
****
*****
2) 12345
1234
123
12
1
3) 1
22
333
4444
55555
1 1
1 2 1 2
1 2 3 1 2 3
1 2 3 4 1 2 3 4
Pystyykö ukkosen etäisyyden laskea laskemalla sekunteja välähdyksestä ja jakamalla sitten kolmella??eli jos välähtää ja siitä noin 9 sekunnin päästä kuuluu jyrinä niin ukkonen on noin kolmen kilometrin päässä…näin joskus jostain opnsnkuulii..=)vi/siin valon nopeuteen 300000m/s liittyvä juttu??
 ( 2012.03.6 17:48 ) : My partner and I stumbled over here different page and thought I may as well check things out. I like what I see so now i am following you. Look forward to checking out your web page for a second time.
I know how difficult this has been for you…and I know that the Lord fills our cups to overflowing because He wants us to rely on Him. With our mutual situations, we have to trust His sovereign plan for our families and rest in the comfort that He loves us and our children more than we can possibly comprehend. I’m praying for you! Drink fully and confidently and rest peacefully in His grace.
I didn’t know where to find this info then kaboom it was here.