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
What is the difference between c and python?
explain what is an endless loop?
Describe how arrays can be passed to a user defined function
What do you mean by a local block?
What is main () in c?
What is the heap in c?
What does 3 mean in texting?
What is file in c language?
Differentiate call by value and call by reference?
What is volatile, register definition in C
hi send me sample aptitude papers of cts?
What are the three constants used in c?
Differentiate between full, complete & perfect binary trees.
What is the difference between struct and typedef struct in c?
Explain about the constants which help in debugging?