Originally Posted by
linda
Hi everyone how r u ... plz i need help am having exam next week and i have the tips but dont have the answer
anyways this is the question:
1- create a program to print prime number .. and for example it can be all the prime numbers under 200 or under 300 and print ... i hope u understand my question .
plz use normal prog like this
Code:
#include <stdio.h>
main()
{
here put where ever
}
return 0;
coz am not good at the other types of program ..
plz try to do it for me as soon as u can or as soon as u see my question ....
thanxx
I just couldn't help it so i followed the instructions of the student, and because brevity is
a virtue i decided to use a recursive technique for the solution
Code:
#include <stdio.h>
int main(int a,int n,int i,int j){return a?puts("Enter number:"),scanf("%d",
&n),main(0,n,2,1):(i%j)?main(0,n,i,j-1):i<n?(j==1?printf("%d\n",i):0),main(0
,n,i+1,(i+1)/2):0;}
There i put wherever between the {} and look what happened !