Write a Program to print this triangle:
*
**
*
****
*
******
*
********
*
**********
use two nested loops.

Answer Posted / naman patidar

void main() {
int n = 5 ; // take use input here
int i, j;
for( i =1; i<=n; i++){
printf("\n *");
for(j=0; j<=i; j++){
printf(" *");
}
}
}

Is This Answer Correct ?    23 Yes 22 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain how do you sort filenames in a directory?

607


Can a function argument have default value?

672


Write program to remove duplicate in an array?

600


What functions are used for dynamic memory allocation in c language?

602


why use functions a) writing functions avoids rewriting the same code over and over b) using functions it becomes easier to write programs and keep track of what they are doing c) a & b d) none of the above

654






What does 1f stand for?

612


What is the process to generate random numbers in c programming language?

610


What the different types of arrays in c?

613


What is uint8 in c?

642


How do you do dynamic memory allocation in C applications?

630


I came across some code that puts a (void) cast before each call to printf. Why?

678


What are the different types of errors?

646


How the c program is executed?

632


What is .obj file in c?

648


Write a programme using structure that create a record of students. The user allow to add a record and delete a record and also show the records in ascending order.

1620