Advertisement
paster442

Untitled

Oct 17th, 2024
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.42 KB | None | 0 0
  1. #define _CRT_SECURE_NO_WARNINGS
  2.  
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5.  
  6.  
  7. int main() {
  8.  
  9.     FILE* fptr;
  10.  
  11.     char filename[50];
  12.     printf("Enter the file name: ");
  13.     scanf("%s", &filename);
  14.  
  15.     fptr = fopen(filename, "r");
  16.  
  17.     char line[200];
  18.  
  19.     while (fgets(line, sizeof(line), fptr)) {
  20.         if (!(line[0] == '/' && line[1] == '/')) {
  21.             printf("%s", line);
  22.         }
  23.     }
  24.  
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement