rajamit872

Table without using loop in C

Sep 25th, 2014
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.31 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<conio.h>
  3. int table(int);
  4. extern i=0;
  5. void main()
  6. {
  7. clrscr();
  8. int num;
  9. printf("Enter any no::");
  10. scanf("%d",&num);
  11.  
  12. table(num);
  13. getch();
  14. }
  15.     int table(int num)
  16.     {
  17.     if(i==10)
  18.     return num*10;
  19.     else
  20.     {
  21.     ++i;
  22.     printf("%d  ",num*i);
  23.     return table(i*table(num));
  24.     }
  25.     }
Advertisement
Add Comment
Please, Sign In to add comment