Write a Program to print this triangle:
*
**
*
****
*
******
*
********
*
**********
use two nested loops.
Answer Posted / abdi
#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 ? | 0 Yes | 1 No |
Post New Answer View All Answers
7-Given an index k, return the kth row of the Pascal's triangle. For example, when k = 3, the row is [1,3,3,1]. For reference look at the following standard pascal’s triangle.
What is a const pointer?
How do you determine whether to use a stream function or a low-level function?
Is null a keyword in c?
Explain the red-black trees?
explain what is fifo?
What is a pointer in c plus plus?
What is the total generic pointer type?
what are the advanced features of functions a) function declaration and prototypes b) calling functions by value or by reference c) recursion d) all the above
What is 2 d array in c?
What is && in c programming?
How can I determine whether a machines byte order is big-endian or little-endian?
What are different storage class specifiers in c?
What is the difference between a function and a method in c?
What is sizeof int?