Sha256: c5253309c2c4b6ed404677591e2f4c91d3158f5656792b40377e4e74e33173f9

Contents?: true

Size: 477 Bytes

Versions: 108

Compression:

Stored size: 477 Bytes

Contents

#include "raindrops.h"
#include "stdio.h"
#include "string.h"
#include <stdlib.h>

char *convert(char result[], int drops)
{
   if (drops % 3 == 0) {
      strcat(result, "Pling");
   }
   if (drops % 5 == 0) {
      strcat(result, "Plang");
   }
   if (drops % 7 == 0) {
      strcat(result, "Plong");
   }
   if (strlen(result) == 0) {
      char drops_string[12] = "\0";
      sprintf(drops_string, "%d", drops);
      strcat(result, drops_string);
   }
   return result;
}

Version data entries

108 entries across 108 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/c/exercises/raindrops/src/example.c
trackler-2.2.1.179 tracks/c/exercises/raindrops/src/example.c
trackler-2.2.1.178 tracks/c/exercises/raindrops/src/example.c
trackler-2.2.1.177 tracks/c/exercises/raindrops/src/example.c
trackler-2.2.1.176 tracks/c/exercises/raindrops/src/example.c
trackler-2.2.1.175 tracks/c/exercises/raindrops/src/example.c
trackler-2.2.1.174 tracks/c/exercises/raindrops/src/example.c
trackler-2.2.1.173 tracks/c/exercises/raindrops/src/example.c
trackler-2.2.1.172 tracks/c/exercises/raindrops/src/example.c
trackler-2.2.1.171 tracks/c/exercises/raindrops/src/example.c
trackler-2.2.1.170 tracks/c/exercises/raindrops/src/example.c
trackler-2.2.1.169 tracks/c/exercises/raindrops/src/example.c
trackler-2.2.1.167 tracks/c/exercises/raindrops/src/example.c
trackler-2.2.1.166 tracks/c/exercises/raindrops/src/example.c
trackler-2.2.1.165 tracks/c/exercises/raindrops/src/example.c
trackler-2.2.1.164 tracks/c/exercises/raindrops/src/example.c
trackler-2.2.1.163 tracks/c/exercises/raindrops/src/example.c
trackler-2.2.1.162 tracks/c/exercises/raindrops/src/example.c
trackler-2.2.1.161 tracks/c/exercises/raindrops/src/example.c
trackler-2.2.1.160 tracks/c/exercises/raindrops/src/example.c