Last active
December 7, 2015 11:09
-
-
Save msuryaprakash/9ffa300926ce018050cc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* PROGRAM TO PRINT NUMBERS OF 1 TO N WITHOUT USING ANY LOOPS */ | |
#include<stdio.h> | |
void Print_Numbers(int,int); //Declaring the Function Definition | |
main() | |
{ | |
int NUM; | |
printf("\n *** Prime Numbers Program in C With Out Using any loops ***"); | |
printf("\n Enter Number of Primes Numbers Required: "); | |
scanf("%d",&NUM); //the value is given by the user | |
Print_Numbers(1,NUM); //calling the function | |
} | |
void Print_Numbers(int i,int max) | |
{ | |
printf("%d\n",i); | |
if(i<max) | |
{ | |
//Calling the Function Recursively | |
Print_Numbers(++i,max); | |
} | |
return; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment