#include <stdio.h> int main() { int n; printf("Enter the number: "); scanf("%d",&n); for(int i=2;i<=n-1;i++){ if(n%i==0) printf("The number is composite"); } return 0;}
28
Enter the number: The number is compositeThe number is compositeThe number is compositeThe number is composite
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!