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.159 tracks/c/exercises/raindrops/src/example.c
trackler-2.2.1.158 tracks/c/exercises/raindrops/src/example.c
trackler-2.2.1.157 tracks/c/exercises/raindrops/src/example.c
trackler-2.2.1.156 tracks/c/exercises/raindrops/src/example.c
trackler-2.2.1.155 tracks/c/exercises/raindrops/src/example.c
trackler-2.2.1.154 tracks/c/exercises/raindrops/src/example.c
trackler-2.2.1.153 tracks/c/exercises/raindrops/src/example.c
trackler-2.2.1.152 tracks/c/exercises/raindrops/src/example.c
trackler-2.2.1.151 tracks/c/exercises/raindrops/src/example.c
trackler-2.2.1.150 tracks/c/exercises/raindrops/src/example.c
trackler-2.2.1.149 tracks/c/exercises/raindrops/src/example.c
trackler-2.2.1.148 tracks/c/exercises/raindrops/src/example.c
trackler-2.2.1.147 tracks/c/exercises/raindrops/src/example.c
trackler-2.2.1.146 tracks/c/exercises/raindrops/src/example.c
trackler-2.2.1.145 tracks/c/exercises/raindrops/src/example.c
trackler-2.2.1.144 tracks/c/exercises/raindrops/src/example.c
trackler-2.2.1.143 tracks/c/exercises/raindrops/src/example.c
trackler-2.2.1.142 tracks/c/exercises/raindrops/src/example.c
trackler-2.2.1.141 tracks/c/exercises/raindrops/src/example.c
trackler-2.2.1.140 tracks/c/exercises/raindrops/src/example.c