Write a Program to print this triangle:
*
**
*
****
*
******
*
********
*
**********
use two nested loops.
Answer Posted / umesh shinde
#include<stdio.h>
int main()
{
int n,i,j;
printf("enter the lines :");
scanf("%d",&n);
for(i=1;i<=n/2;i++)
{
printf("*\n");
for(j=1;j<=2*i;j++)
printf("*");
printf("\n");
}
if(n%2!=0)
printf("\n*");
}
| Is This Answer Correct ? | 8 Yes | 5 No |
Post New Answer View All Answers
What do header files do?
What are the 3 types of structures?
What is the modulus operator?
What are 'near' and 'far' pointers?
Can you apply link and association interchangeably?
Explain how do you view the path?
What is a structural principle?
I need a help with a program: Write a C program that uses data input in determining the whole of points A and a whole of circles B. Find two points in A so that the line which passes through them, cut through the maximum number of circles.
Write a program to print "hello world" without using a semicolon?
Can we assign string to char pointer?
What are operators in c?
Why calloc is better than malloc?
write a program to print the consecutive repeated character from the given string... input string is : hhhhjkutskkkkkggggj output should be like this: hhhhkkkkkgggg anyone help me...
What does the file stdio.h contain?
How to explain the final year project as a fresher please answer with sample project