ccplusplus.com
Learn C, C++ Concepts
Thursday, September 15, 2011
print triangle of asterisks in c
/****************************************************** * File : print-simple-triangle-of-asterisk.c * Author : Saurabh Gupta * Desc : print simple triangle of asterisk * Source : http://saurabhgupta0527.blogspot.com/ * Created : PM 09:34 15 September 2011 * Note : *****************************************************/ #include
int main() { int i, j; for(i = 1; i <= 10; i = i + 1) { for(j = 1; j <= i; j = j + 1) { printf("*"); } printf("\n"); } return 0; } /* * * [sgupta@rhel54x64 c]$ gcc print-simple-triangle-of-asterisk.c -o print-simple-triangle-of-asterisk [sgupta@rhel54x64 c]$ ./print-simple-triangle-of-asterisk * ** *** **** ***** ****** ******* ******** ********* ********** [sgupta@rhel54x64 c]$ */
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment