Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  ,
Language: C/C++
Code:
#include <stdio.h>
int isPrime (int a){
for (int i=2; i<2; i++){
if (a%i ==0)
return 0; 
}
return 1;
}
int main(){
int n;
printf("please enter a number:");
scanf("%d",&n);
for(int i=1; i<=n; i++){
if (isPrime(i))printf("%d,",i);
}
return 0;
}
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
Comments: