Write a Program to print this triangle:
*
**
*
****
*
******
*
********
*
**********
use two nested loops.
Answer Posted / vignesh1988i
#include<stdio.h>
#include<conio.h>
void main()
{
int n;
printf("enter the lines :");
scanf("%d",&n);
for(int i=1;i<=n/2;i++)
{
printf("*\n");
for(int j=1;j<=2*i;j++)
printf("%d",j);
printf("\n");
}
if(n%2!=0)
printf("\n*");
getch();
}
thank u
| Is This Answer Correct ? | 54 Yes | 29 No |
Post New Answer View All Answers
what do you mean by enumeration constant?
Tell me what are bitwise shift operators?
in multiple branching construct "default" case is a) optional b) compulsarily c) it is not include in this construct d) none of the above
What is void main () in c?
What is the right type to use for boolean values in c? Is there a standard type?
What is meant by recursion?
how to find binary of number?
Why isn't any of this standardized in c? Any real program has to do some of these things.
Describe static function with its usage?
How main function is called in c?
write a program for the normal snake games find in most of the mobiles.
Is c is a procedural language?
How do I round numbers?
What are derived data types in c?
The __________ attribute is used to announce variables based on definitions of columns in a table?