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
hello freinds next week my interview in reliance,nybody has an idea about it intervew questions..so tell
Why is C language being considered a middle level language?
Function calling procedures? and their differences? Why should one go for Call by Reference?
Explain modulus operator.
What is null pointer constant?
What is context in c?
How can I find the modification date of a file?
Hai what is the different types of versions and their differences
What does. int *x[](); means ?
What is the use of typedef in structure in c?
How is a pointer variable declared?
Explain how can you restore a redirected standard stream?
What is the behavioral difference when include header file in double quotes (“”) and angular braces (<>)?
How can variables be characterized?
How do you define a string?