Skip to content

Instantly share code, notes, and snippets.

@logicchains
logicchains / primesums.c
Created March 19, 2014 10:56
Prints the sum of primes less than or equal to input numbers.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define INITIAL_ARRAY_CAPACITY 100
int isPrime(int value){
int i;
if (value > 2 && value != 4){
for (i = 2; i < value/2; i++) {
import std.algorithm;
import std.conv;
import std.stdio;
import std.array;
import std.range;
import std.format;
//Compile with ldc2 -O5 -release -disable-boundscheck MagicForest.d
struct forest_t{