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
Write a code on reverse string and its complexity.
What are the types of pointers in c?
hi... can anyone help me to make a two-dimensinal arrays in finding the sum of two elements plzzz. thnx a lot...
Write a program to use switch statement.
How can I access an I o board directly?
What do you mean by recursion in c?
What are the types of macro formats?
What is c language used for?
What does != Mean in c?
What is volatile variable in c with example?
Why isn't any of this standardized in c? Any real program has to do some of these things.
What is pre-emptive data structure and explain it with example?
Should I learn c before c++?
How can I implement a delay, or time a users response, with sub-second resolution?
write a c program to find the sum of five entered numbers using an array named number