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
what are enumerations in C
Explain what is the heap?
Explain what is gets() function?
Tell me when would you use a pointer to a function?
why use "return" statement a) on executing the return statement it immediately transfers the control back to the calling program b) it returns the value present in the parentheses return, to the calling program c) a & b d) none of the above
What are near, far and huge pointers?
What are the differences between Structures and Arrays?
Explain pointer. What are function pointers in C?
i want to know the procedure of qualcomm for getting a job through offcampus
What is typedef struct in c?
What is #include stdlib h?
Why c is known as a mother language?
Write a code to determine the total number of stops an elevator would take to serve N number of people.
What are logical errors and how does it differ from syntax errors?
Why is c called c?