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 are dangling pointers in c?
any restrictions have on the number of 'return' statements that may be present in a function. a) no restriction b) only 2 return statements c) only 1 return statements d) none of the above
Why is it important to memset a variable, immediately after allocating memory to it ?
What is the use of getchar functions?
Differentiate between full, complete & perfect binary trees.
‘SAVEPOINT’ and ‘ROLLBACK’ is used in oracle database to secure the data comment. Give suitable examples of each with sql command.
What is the process to create increment and decrement stamen in c?
code for replace tabs with equivalent number of blanks
what is the differnce between programing langauge and tool? is sas is a programing langauge r tool?
what is the function of pragma directive in c?
What is array of structure in c programming?
In C language, a variable name cannot contain?
Explain how can I convert a string to a number?
#include
What’s a signal? Explain what do I use signals for?