fork download
  1. #include <stdio.h>
  2.  
  3. int FirstNnaturalNums(int n)
  4. {
  5. if(n==1)
  6. return 1;
  7. return FirstNnaturalNums(n-1);
  8. }
  9. int main(void) {
  10. int n;
  11. printf("Enter n: ");
  12. scanf("%d",&n);
  13. printf("%d ",FirstNnaturalNums(n));
  14. return 0;
  15. }
  16.  
Success #stdin #stdout 0.01s 5260KB
stdin
5
stdout
Enter n: 1