Write a Program to print this triangle:
*
**
*
****
*
******
*
********
*
**********
use two nested loops.
Answer Posted / prasanna
#include<stdio.h>
#include<conio.h>
void 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("\n");
}
if(n%2!=0);
printf("\n");
getch();
}
| Is This Answer Correct ? | 10 Yes | 8 No |
Post New Answer View All Answers
What is a far pointer in c?
What is #include stdio h?
Write an efficient algo and C code to shuffle a pack of cards.. this one was a feedback process until we came up with one with no extra storage.
What are the 5 types of inheritance in c ++?
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 the size of structure in c?
Write a code to remove duplicates in a string.
Explain how can I manipulate strings of multibyte characters?
What does malloc () calloc () realloc () free () do?
write a program to create a sparse matrix using dynamic memory allocation.
Why c is faster than c++?
When should structures be passed by values or by references?
What is hash table in c?
What are the benefits of c language?
What is the difference between test design and test case design?