Write a Program to print this triangle:
*
**
*
****
*
******
*
********
*
**********
use two nested loops.
Answers were Sorted based on User's Feedback
Answer / manoj
void main() {
int n = 5 ; // take use input here
int i, j;
for( i =1; i<=n; i++){
printf("\n *");
for(j=1; j<i; j++){
printf(" *");
}
}
}
Is This Answer Correct ? | 8 Yes | 13 No |
Answer / 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 |
how to print electricity bill according to following charges first 100 units -1rs per unit for next 200 units-1.50 rs per unit without using conditions
Where does the name "C" come from, anyway?
what is difference between strcmp & palindrome?
Find if a number is power of two or not?
#define DCHAR char* typedef char* TCHAR; if using these following variables will be declared like DCHAR ch1, ch2; TCHAR ch3, ch4; then what will be types of ch1, ch2, ch3 and ch4?
What is period operator in c?
What is the Purpose of 'extern' keyword in a function declaration?
what is the most appropriate way to write a multi-statement macro?
what is output of the following statetment?Printf(“%x”, -1<<4); ?
related to rdbms query .
write aprogram for There is a mobile keypad with numbers 0-9 and alphabets on it. take input of 7 keys and then form a word from the alphabets present on those keys.
1 Answers iGate, Shashi, Source Bits, Subex,
write a program in reverse the string without using pointer,array,global variable declaration,lib fun only using a function?