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 a constant and types of constants in c?
How can I manipulate strings of multibyte characters?
hello freinds next week my interview in reliance,nybody has an idea about it intervew questions..so tell
write a c program to calculate sum of digits till it reduces to a single digit using recursion
What is sizeof array in c?
what are enumerations in C
A function can make the value of a variable available to another by a) declaring the variable as global variable b) Passing the variable as a parameter to the second function c) Either of the two methods in (A) and (B) d) binary stream
What is %d used for?
how to write a c program to print list of fruits in alpabetical order?
What is a lookup table in c?
swap 2 numbers without using third variable?
The __________ attribute is used to announce variables based on definitions of columns in a table?
Explain the difference between call by value and call by reference in c language?
Explain what are bus errors, memory faults, and core dumps?
Is c easier than java?