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 can I invoke another program (a standalone executable, or an operating system command) from within a c program?
What is zero based addressing?
which one is better structure or union?(other than the space occupied )
How can I make it pause before closing the program output window?
What are types of functions?
What is the difference between array_name and &array_name?
One of the Institutes contains 5 student groups. Every group contains 4 students. Institute wants to store student group’s details in array. Group should contain group member’s details (name and registration number and age), project name, and mark of the group.
1.int a=10; 2.int b=20; 3. //write here 4.b=30; Write code at line 3 so that when the value of b is changed variable a should automatically change with same value as b. 5.
By using C language input a date into it and if it is right?
What is a c token and types of c tokens?
What is encapsulation?
What is console in c language?