<div dir="ltr"><div style>Please only ask question related to clang on this mailing list.</div><div style><br></div><div style>For questions like yours please use stackoverflow or google or something similar.</div><div style>
<br></div><div style>(This function will print the inverse of what you showed</div><div style><br></div><div>void print_tree(int i){</div><div> int k,l;</div><div> for(k=i;k>=0;k--)</div><div> {</div><div> for(l=k;l>=0;l--)</div>
<div> {</div><div> printf("*");</div><div> }</div><div> printf("\n");</div><div> }</div><div>}</div><div><br></div><div>)</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
2013/3/23 akhandal96 <span dir="ltr"><<a href="mailto:akhandal96@gmail.com" target="_blank">akhandal96@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hey,<br>
how to make a tree of the symbol "*"<br>
my code is<br>
#include <stdio.h><br>
#include <conio.h><br>
main(){<br>
clrscr();<br>
<br>
int a,b,c;<br>
for(a=1;a<=10;a++)<br>
{<br>
for(b=1;b<=a;b++)<br>
{<br>
printf("*");<br>
}<br>
printf("\n");<br>
}<br>
getch();<br>
}<br>
<br>
and the output of it is<br>
*<br>
**<br>
***<br>
****<br>
and it goes till the last line having 10 stars,I want the same but<br>
backwards,<br>
and it should be like this,a that a user inputs a value,say 15,then it<br>
should generate the tree having first line 15 stars and the 2nd line 14<br>
stars and so on till 1 star.<br>
<br>
Please,I am a newbie to C,its been few days only I had started<br>
learning,please reply soon.<br>
<br>
Thanks a ton<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://clang-developers.42468.n3.nabble.com/Generate-a-tree-in-C-language-tp4031110.html" target="_blank">http://clang-developers.42468.n3.nabble.com/Generate-a-tree-in-C-language-tp4031110.html</a><br>
Sent from the Clang Developers mailing list archive at Nabble.com.<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</blockquote></div><br></div>