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("*");
printf("\n");
}
if(n%2!=0)
printf("\n*");
getch();
}
| Is This Answer Correct ? | 29 Yes | 11 No |
Post New Answer View All Answers
Write a function expand(s1,s2) that expands shorthand notations like a-z in the string s1 into the equivalent complete list abc...xyz in s2 . Allow for letters of either case and digits, and be prepared to handle cases like a-b-c and a-z0-9 and -a-z. z-a:zyx......ba -1-6-:-123456- 1-9-1:123456789987654321 a-R-L:a-R...L a-b-c:abbc
How can I dynamically allocate arrays?
What is static identifier?
What is cohesion and coupling in c?
What is typedef example?
Can you please explain the difference between malloc() and calloc() function?
What's the right way to use errno?
How old is c programming language?
What is difference between union and structure in c?
Which header file should you include if you are to develop a function which can accept variable number of arguments?
In c programming typeing to occupy the variables in memory space. if not useing the variable the memory space is wasted.ok, how to avoid the situation..? (the variable is used & notused)
please explain every phase in the "SDLC" in the dotnet.
Explain what standard functions are available to manipulate strings?
What does %2f mean in c?
p*=(++q)++*--p when p=q=1 while(q<=6)