Date created: Sunday, July 10, 2011 7:08:29 PM. Last modified: Thursday, December 13, 2012 11:41:20 AM
Problem 5
// Project Euler - Problem 5 #include <stdlib.h> int main (int argc, char *argv[]) { int natural = atoi(argv[1]); int i = 1; int j = 1; while (1) { while(j<=natural) { if (i % j == 0) { if (j==natural) { printf("Its %d\n", i); exit(EXIT_SUCCESS); } j++; } else { j = natural + 1; } } i++; j=1; } return EXIT_SUCCESS; }