Write a Program to print this triangle:
*
**
*
****
*
******
*
********
*
**********
use two nested loops.
Answer Posted / vignesh1988i
#include<stdio.h>
#include<conio.h>
void main()
{
int n;
printf("enter the lines :");
scanf("%d",&n);
for(int i=1;i<=n/2;i++)
{
printf("*\n");
for(int j=1;j<=2*i;j++)
printf("*");
printf("\n");
}
if(n%2!=0)
printf("\n*");
getch();
}
| Is This Answer Correct ? | 29 Yes | 11 No |
Post New Answer View All Answers
how can i access hard disk address(physical address)? are we access hard disk by using far,near or huge pointer? if yes then please explain.....
What is break in c?
What is struct node in c?
What is main function in c?
What is the c value paradox and how is it explained?
hai iam working in sap sd module for one year and working in lumax ind ltd in desp department but my problem is i have done m.b.a in hr/marketing and working sap sd there is any combination it. can you give right solution of my problem. and what can i do?
How to find a missed value, if you want to store 100 values in a 99 sized array?
Can we initialize extern variable in c?
A SIMPLE PROGRAM OF GRAPHICS AND THEIR OUTPUT I WANT SEE WAHAT OUTOUT OF GRAPHICS PROGRAM
how can i write a program that prints out a box such that whenever i press any key8(coordinate number) on the keyboard, the box moves.
Can we declare function inside main?
What are extern variables in c?
How can I display a percentage-done indication that updates itself in place, or show one of those twirling baton progress indicators?
What is pre-emptive data structure and explain it with example?
When the macros gets expanded?