Write a Program to print this triangle:
*
**
*
****
*
******
*
********
*
**********
use two nested loops.

Answers were Sorted based on User's Feedback



Write a Program to print this triangle: * ** * **** * ****** * ******** * ********** use ..

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

Write a Program to print this triangle: * ** * **** * ****** * ******** * ********** use ..

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

Post New Answer

More C Interview Questions

What are advantages and disadvantages of recursive calling ?

12 Answers   College School Exams Tests, Evolving Systems, HP, Jyoti Ltd, Sage, Wipro,


Are there constructors in c?

0 Answers  


How are structure passing and returning implemented?

0 Answers  


Read N characters in to an array . Use functions to do all problems and pass the address of array to function. 2. Enter alphanumeric characters and form 2 array alphaets and digits.Also print the count of each array.

0 Answers  


Write a program to print the following series 2 5 11 17 23 31 41 47 59 ...

2 Answers  






What’s a signal? Explain what do I use signals for?

0 Answers  


a value that does not change during program execution a) variabe b) argument c) parameter d) none

0 Answers  


Differentiate between static and dynamic modeling.

0 Answers   Wipro,


What is && in c programming?

0 Answers  


write a c program to find the roots of a quadratic equation ax2 + bx + c = 0

11 Answers   CSC, St Marys, TATA,


Which of the following sorts is quickest when sorting the following set: 1 2 3 5 4 1) Quick Sort 2) Bubble Sort 3) Merge Sort

7 Answers  


how do you programme Carrier Sense Multiple Access

0 Answers  


Categories