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
Does c have circular shift operators?
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
What is union and structure in c?
Is it possible to execute code even after the program exits the main() function?
What is a pointer value and address in c?
how to introdu5ce my self in serco
Where is c used?
What is variable declaration and definition in c?
What is character set?
what is stack , heap ,code segment,and data segment
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.
How many keywords are there in c?
What are the storage classes in C?
Explain what are linked list?
Which one would you prefer - a macro or a function?