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
How many keywords (reserve words) are in c?
How would you obtain the current time and difference between two times?
Why do we use c for the speed of light?
What is wrong with this program statement?
What does the error message "DGROUP exceeds 64K" mean?
What are the features of the c language?
Explain what is #line used for?
What are types of functions?
write an algorithm to display a square matrix.
How is = symbol different from == symbol in c programming?
A collection of data with a given structure for excepting storing and providing on demand data for multiple users a) linked list b) datastructer c) database d) preprocessor
Do you know the purpose of 'register' keyword?
What are keywords c?
What is string constants?
Explain the difference between malloc() and calloc() function?