9511_workbook

solved exercises from algorithms & programming I (9511) prof. Cardozo
Index Commits Files Refs README
guia03/ex10.c (236B)
   1 #include <stdio.h>
   2 #include <string.h>
   3 
   4 
   5 
   6 int main(void) {
   7 
   8     char src[] = "Hello world!\n";
   9     size_t i, n;
  10 
  11     n = 12;
  12     char cpy[n];
  13 
  14     for(i = 0; i <= n; i++) {
  15         cpy[i] = src[i];
  16     }
  17 
  18     printf("%s", src);
  19     printf("%s", cpy);
  20 
  21 
  22     return 0;
  23 }