Write a Program to print this triangle:
*
**
*
****
*
******
*
********
*
**********
use two nested loops.
Answer Posted / adhiraj keshri
#include<stdio.h>
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("*");
printf("\n");
}
if(n%2!=0)
printf("\n*");
}
| Is This Answer Correct ? | 4 Yes | 5 No |
Post New Answer View All Answers
how to build a exercise findig min number of e heap with list imlemented?
What is the condition that is applied with ?: Operator?
What are identifiers c?
Where local variables are stored in c?
How to establish connection with oracle database software from c language?
Do you know the use of 'auto' keyword?
Are pointers integers in c?
Why static variable is used in c?
What are the different data types in C?
Is there a way to compare two structure variables?
What is %lu in c?
I have seen function declarations that look like this
How pointers are declared?
Explain output of printf("Hello World"-'A'+'B'); ?
What is bash c?