geeksforgeeks
  • Courses
  • Tutorials
  • Interview Prep
  • C Tutorial
  • Interview Questions
  • Examples
  • Quizzes
  • Projects
  • Cheatsheet
  • File Handling
  • Multithreading
  • Memory Layout
  • DSA in C
  • C++

C File Handling Programs

Last Updated : 23 Jul, 2025

C Program to list all files and sub-directories in a directory

C Program to count number of lines in a file

C Program to print contents of file

C Program to copy contents of one file to another file

C Program to merge contents of two files into a third file

C program to delete a file

Comment
Article Tags:
Article Tags:
C Programs
C Language
C-File Handling
C File Handling Programs

Explore

    Basics
    • Introduction4 min read
    • Identifiers3 min read
    • Keywords1 min read
    • Variables4 min read
    • Data Types4 min read
    • Operators8 min read
    • Conditional Statements5 min read
    • Loops6 min read
    • Functions4 min read
    Arrays & Strings
    • Arrays4 min read
    • Strings5 min read
    Pointers and Structures
    • Pointers7 min read
    • Function Pointer5 min read
    • Unions3 min read
    • Enumeration4 min read
    • Structure Alignment, Padding & Data Packing8 min read
    Memory Management
    • Memory Layout5 min read
    • Dynamic Memory Allocation7 min read
    • Memory Leak2 min read
    File & Error Handling
    • File Handling11 min read
    • Read/Write Structures3 min read
    • Error Handling7 min read
    • Using goto for Exception Handling in C2 min read
    • File Error Handling4 min read
    Advanced Concepts
    • Variadic Functions4 min read
    • Signals in C5 min read
    • Socket Programming8 min read
    • _Generics Keyword3 min read
    • Multithreading7 min read
    Courses
    • DSA CPP Course2 min read
    • DSA and System Design Course2 min read
    • OS, CN, DBMS Course2 min read
GeeksforGeeks
location
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
location
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play StoreGFG App on App Store
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Campus Training Program
  • Explore
  • POTD
  • Job-A-Thon
  • Blogs
  • Nation Skill Up
  • Tutorials
  • Programming Languages
  • DSA
  • Web Technology
  • AI, ML & Data Science
  • DevOps
  • CS Core Subjects
  • Interview Preparation
  • Software and Tools
  • Courses
  • ML and Data Science
  • DSA and Placements
  • Web Development
  • Programming Languages
  • DevOps & Cloud
  • GATE
  • Trending Technologies
  • Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
  • Preparation Corner
  • Interview Corner
  • Aptitude
  • Puzzles
  • GfG 160
  • System Design
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved