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

Answer Posted / naman patidar

void main() {
int n = 5 ; // take use input here
int i, j;
for( i =1; i<=n; i++){
printf("\n *");
for(j=0; j<=i; j++){
printf(" *");
}
}
}

Is This Answer Correct ?    23 Yes 22 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is sizeof in c?

582


What is the return type of sizeof?

603


What are the c keywords?

759


Differentiate between the expression “++a” and “a++”?

713


Are the outer parentheses in return statements really optional?

584






Should I learn c before c++?

653


the constant value in the case label is followed by a a) semicolon b) colon c) braces d) none of the above

731


Why is c fast?

616


swap 2 numbers without using third variable?

672


What is the difference between procedural and functional programming?

532


How can I get back to the interactive keyboard if stdin is redirected?

679


Explain how are 16- and 32-bit numbers stored?

791


What are the different categories of functions in c?

664


How to Throw some light on the splay trees?

625


please give me a VIRTUSA sample palcement papers.... you will only send TECHNICAL SECTION..... that is help for me Advance Thanks........................

1547