Sep 25, 2011

Printed figures of 1-10 without the use of a camel spin (using the idea of ​​recursion):


#include <iostream.h>
#include <conio.h>int num (int);void main (){int i=1;cout << num (i);getch ();}int num (int i){if (i<10)cout << num (i+1)<< "\n";return i;}



0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Premium Wordpress Themes