Skip to content

Instantly share code, notes, and snippets.

@encodes1
Created May 10, 2013 12:29
Show Gist options
  • Save encodes1/5554126 to your computer and use it in GitHub Desktop.
Save encodes1/5554126 to your computer and use it in GitHub Desktop.
Week 1 - Challenge 1
#include<stdio.h>
int main()
{
int n, i = 3, x, c;
printf("Enter the start number\n");
scanf("%d",&c);
printf("Enter the last number\n");
scanf("%d",&n);
printf("\n");
for(;c <=n; c++){
for(x=2; x< c; x++){
if(c%x == 0){
break;
}
}
if(c ==2){
x=1;
}
if(c ==x){
printf("%d\n",c);
}
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment