9511_workbook

solved exercises from algorithms & programming I (9511) prof. Cardozo
Index Commits Files Refs README
guia03/ex22.c (278B)
   1 #include <stdio.h>
   2 #include <stdlib.h>
   3 
   4 #define MAX_LEN 100
   5 
   6 int main ( void ) {
   7 
   8     char buffer[MAX_LEN];
   9     int num;
  10     char num2[MAX_LEN];
  11 
  12     if(fgets(buffer, MAX_LEN, stdin) == NULL)
  13         return 1;
  14 
  15     num = atoi(buffer);
  16     sprintf(num2, "%d\n", num);
  17 
  18     printf("%s", num2);
  19     return 0;
  20 }