Lista Final Q.3

Run Settings
LanguageC
Language Version
Run Command
#include <stdio.h> #include <stdlib.h> #include <string.h> int main() { int cont; char arq[50], tipo[10]; printf("Digite o nome do arquivo: "); gets(arq); printf("Digite a extensao do arquivo (ex: .txt, .cpp..): "); gets(tipo); strcat(arq, tipo); FILE *f = fopen(arq, "r"); if(f == NULL) { printf("Arquivo nao pode ser aberto!\n"); return 1; } char Linha[100]; while (!feof(f)) { ++cont; fgets(Linha, 100, f); printf("%d: %s",cont, Linha); } fclose(f); return 0; }
Editor Settings
Theme
Key bindings
Full width
Lines