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

Answer Posted / srinivas 9491582281

#include<stdio.h>
#include<conio.h>
main()
{
int i,j;
clrscr();
for(i=1;i<=10;i++)
{
if(i%2!=0)
printf("*\n");
else
{
for(j=1;j<=i;j++)
printf("*");
printf("\n");
}
}
getch();
}

Is This Answer Correct ?    15 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Does c have circular shift operators?

731


The number of bytes of storage occupied by short, int and long are a) 2, 2 and 4 b) 2, 4 and 4 c) 4, 4 and 4 d) none

764


What is union and structure in c?

618


Is it possible to execute code even after the program exits the main() function?

815


What is a pointer value and address in c?

636






how to introdu5ce my self in serco

1521


Where is c used?

648


What is variable declaration and definition in c?

503


What is character set?

685


what is stack , heap ,code segment,and data segment

2223


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


How many keywords are there in c?

591


What are the storage classes in C?

625


Explain what are linked list?

626


Which one would you prefer - a macro or a function?

604