#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(void) {
char s[] = "java c c++ c# php python";
char *first_N_chars = malloc(strlen(s) + 1);
if (first_N_chars == NULL) {
puts("malloc error");
exit(1);
}
int N = 12;
strncpy(first_N_chars, s, N);
first_N_chars[N] = '\0';
printf("%s", first_N_chars);
free(first_N_chars);
}
/*
run:
java c c++ c
*/