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
What is malloc() function?
write a program in C that prompts the user for today's date,tomorrow's date and display the results.Use structures for today's date,tomorrow's date and an array to hold the days for each month of the year.
How can I make it pause before closing the program output window?
Give the rules for variable declaration?
What is wild pointer in c?
‘SAVEPOINT’ and ‘ROLLBACK’ is used in oracle database to secure the data comment. Give suitable examples of each with sql command.
Write a program to reverse a given number in c language?
What is class and object in c?
What is #include stdio h and #include conio h?
How can you pass an array to a function by value?
How can a program be made to print the line number where an error occurs?
void main(int n) { if(n==0) return; main(--n); printf("%d ",n); getch(); } how it work and what will be its output...............it any one know ans plz reply
Why do we write return 0 in c?
How to define structures? ·
What is time null in c?