plz somebody help me with this C code...i need it for my assignment..i tried to do it...but its not working.the assignment is that.."write a C program that will give the prime number between 1-10...(using loops n break)
Code: #include<stdio.h> #include<conio.h> void main() { int i,c=0,n; clrscr(); printf("Enter any number"); scanf("%d",&n); for(i=1,c=0;i<=n;i++) { if(n%i==0) c++; } if(c==2) printf("%d",i); else break; getch(); }