Write a Program to print this triangle:
*
**
*
****
*
******
*
********
*
**********
use two nested loops.
Answer Posted / vignesh1988i
#include<stdio.h>
#include<conio.h>
void main()
{
int n;
printf("enter the lines :");
scanf("%d",&n);
for(int i=1;i<=n/2;i++)
{
printf("*\n");
for(int j=1;j<=2*i;j++)
printf("%d",j);
printf("\n");
}
if(n%2!=0)
printf("\n*");
getch();
}
thank u
| Is This Answer Correct ? | 54 Yes | 29 No |
Post New Answer View All Answers
What is %lu in c?
Explain the bubble sort algorithm.
What’s a signal? Explain what do I use signals for?
write an algorithm to display a square matrix.
Do string constants represent numerical values?
Explain the properties of union. What is the size of a union variable
Why double pointer is used in c?
if (i = 0)printf ("True"); elseprintf("False"); Under what conditions will the above print out the string "True" a) Never b) Always c) When the value of i is 0 d) all of the above
why programs in c are running with out #include
When is the “void” keyword used in a function?
please send me the code for multiplying sparse matrix using c
hi to every one .. how to view table pool after creating the pooled table? plz help me.. if any knows abt this ..
What is structure in c language?
What is c definition?
What are data types in c language?