Write a Program to print this triangle:
*
**
*
****
*
******
*
********
*
**********
use two nested loops.
Answer Posted / vikram sharma
<?php
for($i=0;$i<10;$i++){
for($j=0;$j<=$i;$j++){
if($i%2!=0 || $i==0 || $j==1)
echo"*";
}
echo"</br>";
}
?>
| Is This Answer Correct ? | 7 Yes | 12 No |
Post New Answer View All Answers
Do string constants represent numerical values?
Are the variables argc and argv are always local to main?
What is default value of global variable in c?
What is the advantage of c?
Is main a keyword in c?
a construct the"else" part of "if" statement contains anoth "if else" statement is called a) if-else b) else-if-else c) if-else-if-else d) chain if/if-else-if
I need testPalindrome and removeSpace
#include
What is string length in c?
Why calloc is better than malloc?
Can you write the function prototype, definition and mention the other requirements.
What is the meaning of && in c?
Can I initialize unions?
Is a house a mass structure?
how to solve "unable to open stdio.h and conio.h header files in windows 7 by using Dos-box software
Explain the array representation of a binary tree in C.