Basics of File Handling in C - GeeksforGeeks

Download as pdf or txt
Download as pdf or txt
You are on page 1of 23

C C Basics C Data Types C Operators C Input and Output C Control Flow C Functions C

Basics of File Handling in C


Last Updated : 11 Oct, 2024

File handling in C is the process in which we create, open, read, write,


and close operations on a file. C language provides different functions
such as fopen(), fwrite(), fread(), fseek(), fprintf(), etc. to perform input,
output, and many different C file operations in our program.

Why do we need File Handling in C?


So far the operations using the C program are done on a
prompt/terminal which is not stored anywhere. The output is deleted
when the program is closed. But in the software industry, most
programs are written to store the information fetched from the
program. The use of file handling is exactly what the situation calls for.

In order to understand why file handling is important, let us look at a


few features of using files:

Reusability: The data stored in the file can be accessed, updated,


and deleted anywhere and anytime providing high reusability.
Portability: Without losing any data, files can be transferred to
another in the computer system. The risk of flawed coding is
minimized with this feature.
Efficient: A large amount of input may be required for some
programs. File handling allows you to easily access a part of a file
using few instructions which saves a lot of time and reduces the
chance of errors.
Storage Capacity: Files allow you to store a large amount of data
without having to worry about storing everything simultaneously in a
program.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our Cookie Policy & Privacy Policy Cookies are not
If you’re interested in working
collected with filesmobile
in the GeeksforGeeks and applications.
integrating them into larger
data structures, the C Programming
Got It !Course Online with Data
Structures provides detailed lessons on file management in C.

Types of Files in C
A file can be classified into two types based on the way the file stores
the data. They are as follows:

Text Files
Binary Files

1. Text Files

A text file contains data in the form of ASCII characters and is


generally used to store a stream of characters.

Each line in a text file ends with a new line character (‘\n’).
It can be read or written by any text editor.
They are generally stored with .txt file extension.
Text files can also be used to store the source code.

2. Binary Files

A binary file contains data in binary form (i.e. 0’s and 1’s) instead of
ASCII characters. They contain data that is stored in a similar manner
tocookies
We use how ittoisensure
stored in the
you have themain memory.
best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our Cookie Policy & Privacy Policy Cookies are not
The binary files caninbe
collected thecreated onlymobile
GeeksforGeeks from applications.
within a program and their
contents can only be read by a program.
More secure as they are not easily readable.
They are generally stored with .bin file extension.

C File Operations
C file operations refer to the different possible operations that we can
perform on a file in C such as:

1. Creating a new file – fopen() with attributes as “a” or “a+” or “w” or


“w+”
2. Opening an existing file – fopen()
3. Reading from file – fscanf() or fgets()
4. Writing to a file – fprintf() or fputs()
5. Moving to a specific location in a file – fseek(), rewind()
6. Closing a file – fclose()

The highlighted text mentions the C function used to perform the file
operations.

Functions for C File Operations

File Pointer in C
A file pointer is a reference to a particular position in the opened file. It
is used in file handling to perform all file operations such as read, write,
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
close, etc. We use the FILE macro to declare the file pointer variable.
acknowledge that you have read and understood our Cookie Policy & Privacy Policy Cookies are not
The FILE macrocollected
is defined inside <stdio.h>
in the GeeksforGeeks mobileheader file.
applications.
Syntax of File Pointer

FILE* pointer_name;

File Pointer is used in almost all the file operations in C.

Open a File in C
For opening a file in C, the fopen() function is used with the filename or
file path along with the required access modes.

Syntax of fopen()

FILE* fopen(const char *file_name, const char


*access_mode);

Parameters

file_name: name of the file when present in the same directory as the
source file. Otherwise, full path.
access_mode: Specifies for what operation the file is being opened.

Return Value

If the file is opened successfully, returns a file pointer to it.


If the file is not opened, then returns NULL.

File opening modes in C

File opening modes or access modes specify the allowed operations on


the file to be opened. They are passed as an argument to the fopen()
function. Some of the commonly used file access modes are listed
below:

We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our Cookie Policy & Privacy Policy Cookies are not
collected in the GeeksforGeeks mobile applications.
Opening Description
Modes

Searches file. If the file is opened successfully fopen( ) loads


it into memory and sets up a pointer that points to the first
r
character in it. If the file cannot be opened fopen( ) returns
NULL.

Open for reading in binary mode. If the file does not exist,
rb
fopen( ) returns NULL.

Open for writing in text mode. If the file exists, its contents
w are overwritten. If the file doesn’t exist, a new file is created.
Returns NULL, if unable to open the file.

Open for writing in binary mode. If the file exists, its contents
wb
are overwritten. If the file does not exist, it will be created.

Searches file. If the file is opened successfully fopen( ) loads


it into memory and sets up a pointer that points to the last
a character in it. It opens only in the append mode. If the file
doesn’t exist, a new file is created. Returns NULL, if unable to
open the file.

Open for append in binary mode. Data is added to the end of


ab
the file. If the file does not exist, it will be created.

Searches file. It is opened successfully fopen( ) loads it into


r+ memory and sets up a pointer that points to the first
character in it. Returns NULL, if unable to open the file.

Open for both reading and writing in binary mode. If the file
rb+
does not exist, fopen( ) returns NULL.

We use cookies to ensureSearches


you have the best
file. browsing
If the experience
file exists, on our website.
its contents By using our site,
are overwritten. If you
acknowledge that you have read and understood our Cookie Policy & Privacy Policy Cookies are not
w+ the file doesn’t exist a new file is created. Returns NULL, if
collected in the GeeksforGeeks mobile applications.
unable to open the file.
Opening Description
Modes

Open for both reading and writing in binary mode. If the file
wb+ exists, its contents are overwritten. If the file does not exist, it
will be created.

Searches file. If the file is opened successfully fopen( ) loads


it into memory and sets up a pointer that points to the last
a+ character in it. It opens the file in both reading and append
mode. If the file doesn’t exist, a new file is created. Returns
NULL, if unable to open the file.

Open for both reading and appending in binary mode. If the


ab+
file does not exist, it will be created.

As given above, if you want to perform operations on a binary file, then


you have to append ‘b’ at the last. For example, instead of “w”, you have
to use “wb”, instead of “a+” you have to use “a+b”.

Example of Opening a File

// C Program to illustrate file opening


#include <stdio.h>
#include <stdlib.h>

int main()
{
// file pointer variable to store the value returned by
// fopen
FILE* fptr;

// opening the file in read mode


fptr = fopen("filename.txt", "r");

// checking
We use cookies to ensure you have theifbestthe file experience
browsing is opened successfully
on our website. By using our site, you
if (fptr == NULL) {
acknowledge that you have read and understood our Cookie Policy & Privacy Policy Cookies are not
printf("The file is not opened. The program will "
collected in the GeeksforGeeks mobile applications.
"now exit.");
exit(0);
}
return 0;
}

Output

The file is not opened. The program will now exit.

The file is not opened because it does not exist in the source directory.
But the fopen() function is also capable of creating a file if it does not
exist. It is shown below

Create a File in C
The fopen() function can not only open a file but also can create a file if
it does not exist already. For that, we have to use the modes that allow
the creation of a file if not found such as w, w+, wb, wb+, a, a+, ab, and
ab+.

FILE *fptr;
fptr = fopen("filename.txt", "w");

Example of Opening a File

// C Program to create a file


#include <stdio.h>
#include <stdlib.h>

int main()
{
// file pointer
FILE* fptr;

// creating file using fopen() access mode "w"


fptr = fopen("file.txt", "w");

// checking if the file is created


We use cookies to ensure you have==
if (fptr theNULL)
best browsing
{ experience on our website. By using our site, you
acknowledge that you have read and understood
printf("The file our
is Cookie Policy & Privacy
not opened. Policy Cookies
The program will are
" not
collected in "exit now");
the GeeksforGeeks mobile applications.
exit(0);
}
else {
printf("The file is created Successfully.");
}

return 0;
}

Output

The file is created Successfully.

Reading From a File


The file read operation in C can be performed using functions fscanf()
or fgets(). Both the functions performed the same operations as that of
scanf and gets but with an additional parameter, the file pointer. There
are also other functions we can use to read from a file. Such functions
are listed below:

Function Description

Use formatted string and variable arguments list to take input


fscanf()
from a file.

fgets() Input the whole line from the file.

fgetc() Reads a single character from the file.

fgetw() Reads a number from a file.

fread() Reads the specified bytes of data from a binary file.

So, it depends on you if you want to read the file line by line or character
by character.

We use cookies to ensure you have the best browsing experience on our website. By using our site, you
Example:
acknowledge that you have read and understood our Cookie Policy & Privacy Policy Cookies are not
collected in the GeeksforGeeks mobile applications.
FILE * fptr;
fptr = fopen(“fileName.txt”, “r”);
fscanf(fptr, "%s %s %s %d", str1, str2, str3, &year);
char c = fgetc(fptr);

The getc() and some other file reading functions return EOF (End Of
File) when they reach the end of the file while reading. EOF indicates
the end of the file and its value is implementation-defined.

Note: One thing to note here is that after reading a particular part of
the file, the file pointer will be automatically moved to the end of the
last read character.

Write to a File
The file write operations can be performed by the functions fprintf()
and fputs() with similarities to read operations. C programming also
provides some other functions that can be used to write data to a file
such as:

Function Description

Similar to printf(), this function use formatted string and


fprintf()
varible arguments list to print output to the file.

fputs() Prints the whole line in the file and a newline at the end.

fputc() Prints a single character into the file.

fputw() Prints a number to the file.

This functions write the specified amount of bytes to the


fwrite()
binary file.

We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge
Example: that you have read and understood our Cookie Policy & Privacy Policy Cookies are not
collected in the GeeksforGeeks mobile applications.
FILE *fptr ;
fptr = fopen(“fileName.txt”, “w”);
fprintf(fptr, "%s %s %s %d", "We", "are", "in", 2012);
fputc("a", fptr);

Closing a File
The fclose() function is used to close the file. After successful file
operations, you must always close a file to remove it from the memory.

Syntax of fclose()

fclose(file_pointer);

where the file_pointer is the pointer to the opened file.

Example:

FILE *fptr ;
fptr= fopen(“fileName.txt”, “w”);
---------- Some file Operations -------
fclose(fptr);

Examples of File Handing in C

Example 1: Program to Create a File, Write in it, And Close the File

// C program to Open a File,


// Write in it, And Close the File
#include <stdio.h>
#include <string.h>

int main()
{
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you//have
Declare
read andthe file pointer
understood our Cookie Policy & Privacy Policy Cookies are not
FILE* filePointer;
collected in the GeeksforGeeks mobile applications.
// Get the data to be written in file
char dataToBeWritten[50] = "GeeksforGeeks-A Computer "
"Science Portal for Geeks";

// Open the existing file GfgTest.c using fopen()


// in write mode using "w" attribute
filePointer = fopen("GfgTest.c", "w");

// Check if this filePointer is null


// which maybe if the file does not exist
if (filePointer == NULL) {
printf("GfgTest.c file failed to open.");
}
else {

printf("The file is now opened.\n");

// Write the dataToBeWritten into the file


if (strlen(dataToBeWritten) > 0) {

// writing in the file using fputs()


fputs(dataToBeWritten, filePointer);
fputs("\n", filePointer);
}

// Closing the file using fclose()


fclose(filePointer);

printf("Data successfully written in file "


"GfgTest.c\n");
printf("The file is now closed.");
}

return 0;
}

Output

The file is now opened.


Data successfully written in file GfgTest.c
The file is now closed.

This program will create a file named GfgTest.c in the same directory
as the source file which will contain the following text: “GeeksforGeeks-
A Computer Science Portal for Geeks”.

Example 2: Program to Open a File, Read from it, And Close the File
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our Cookie Policy & Privacy Policy Cookies are not
C
collected in the GeeksforGeeks mobile applications.
// C program to Open a File,
// Read from it, And Close the File
#include <stdio.h>
#include <string.h>

int main()
{

// Declare the file pointer


FILE* filePointer;

// Declare the variable for the data to be read from


// file
char dataToBeRead[50];

// Open the existing file GfgTest.c using fopen()


// in read mode using "r" attribute
filePointer = fopen("GfgTest.c", "r");

// Check if this filePointer is null


// which maybe if the file does not exist
if (filePointer == NULL) {
printf("GfgTest.c file failed to open.");
}
else {

printf("The file is now opened.\n");

// Read the dataToBeRead from the file


// using fgets() method
while (fgets(dataToBeRead, 50, filePointer)
!= NULL) {

// Print the dataToBeRead


printf("%s", dataToBeRead);
}

// Closing the file using fclose()


fclose(filePointer);

printf(
"Data successfully read from file
GfgTest.c\n");
printf("The file is now closed.");
}
return 0;
}

Output
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our Cookie Policy & Privacy Policy Cookies are not
collected in the GeeksforGeeks mobile applications.
The file is now opened.
GeeksforGeeks-A Computer Science Portal for Geeks
Data successfully read from file GfgTest.c
The file is now closed.

This program reads the text from the file named GfgTest.c which we
created in the previous example and prints it in the console.

Read and Write in a Binary File


Till now, we have only discussed text file operations. The operations on
a binary file are similar to text file operations with little difference.

Opening a Binary File

To open a file in binary mode, we use the rb, rb+, ab, ab+, wb, and wb+
access mode in the fopen() function. We also use the .bin file extension
in the binary filename.

Example

fptr = fopen("filename.bin", "rb");

Write to a Binary File

We use fwrite() function to write data to a binary file. The data is written
to the binary file in the from of bits (0’s and 1’s).

Syntax of fwrite()

size_t fwrite(const void *ptr, size_t size, size_t nmemb,


FILE *file_pointer);

Parameters:

ptr: pointer to the block of memory to be written.


size: size of each element to be written (in bytes).
nmemb: number of elements.
file_pointer: FILE pointer to the output file stream.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our Cookie Policy & Privacy Policy Cookies are not
Return Value: collected in the GeeksforGeeks mobile applications.

Number of objects written.


Example: Program to write to a Binary file using fwrite()

// C program to write to a Binary file using fwrite()


#include <stdio.h>
#include <stdlib.h>
struct threeNum {
int n1, n2, n3;
};
int main()
{
int n;
// Structure variable declared here.
struct threeNum num;
FILE* fptr;
if ((fptr = fopen("C:\\program.bin", "wb")) == NULL) {
printf("Error! opening file");
// If file pointer will return NULL
// Program will exit.
exit(1);
}
int flag = 0;
// else it will return a pointer to the file.
for (n = 1; n < 5; ++n) {
num.n1 = n;
num.n2 = 5 * n;
num.n3 = 5 * n + 1;
flag = fwrite(&num, sizeof(struct threeNum), 1,
fptr);
}

// checking if the data is written


if (!flag) {
printf("Write Operation Failure");
}
else {
printf("Write Operation Successful");
}

fclose(fptr);

return 0;
}

Output
We useWrite
cookies to ensure you have
Operation the best browsing experience on our website. By using our site, you
Successful
acknowledge that you have read and understood our Cookie Policy & Privacy Policy Cookies are not
collected in the GeeksforGeeks mobile applications.
Reading from Binary File
The fread() function can be used to read data from a binary file in C.
The data is read from the file in the same form as it is stored i.e. binary
form.

Syntax of fread()

size_t fread(void *ptr, size_t size, size_t nmemb, FILE


*file_pointer);

Parameters:

ptr: pointer to the block of memory to read.


size: the size of each element to read(in bytes).
nmemb: number of elements.
file_pointer: FILE pointer to the input file stream.

Return Value:

Number of objects written.

Example: Program to Read from a binary file using fread()

// C Program to Read from a binary file using fread()


#include <stdio.h>
#include <stdlib.h>
struct threeNum {
int n1, n2, n3;
};
int main()
{
int n;
struct threeNum num;
FILE* fptr;
if ((fptr = fopen("C:\\program.bin", "rb")) == NULL) {
printf("Error! opening file");
// If file pointer will return NULL
// Program will exit.
exit(1);
}
// else it will return a pointer to the file.
foryou
We use cookies to ensure (nhave
= 1;thenbest
< 5; ++n) experience
browsing { on our website. By using our site, you
acknowledge that you have read and understood our Cookie Policy & Privacy 1,
fread(&num, sizeof(struct threeNum), fptr);
Policy Cookies are not
printf("n1: %d\tn2: %d\tn3: %d\n", num.n1, num.n2,
collected in the GeeksforGeeks mobile applications.
num.n3);
}
fclose(fptr);
return 0;
}

Output

n1: 1 n2: 5 n3: 6


n1: 2 n2: 10 n3: 11
n1: 3 n2: 15 n3: 16
n1: 4 n2: 20 n3: 21

fseek() in C
If we have multiple records inside a file and need to access a particular
record that is at a specific position, so we need to loop through all the
records before it to get the record. Doing this will waste a lot of
memory and operational time. To reduce memory consumption and
operational time we can use fseek() which provides an easier way to
get to the required data. fseek() function in C seeks the cursor to the
given record in the file.

Syntax for fseek()

int fseek(FILE *ptr, long int offset, int pos);

Example of fseek()

// C Program to demonstrate the use of fseek() in C


#include <stdio.h>

int main()
{
FILE* fp;
We use cookies to ensure
fp =youfopen("test.txt",
have the best browsing "r");
experience on our website. By using our site, you
acknowledge that you have read and understood our Cookie Policy & Privacy Policy Cookies are not
// collected
Moving inpointer to end mobile applications.
the GeeksforGeeks
fseek(fp, 0, SEEK_END);
// Printing position of pointer
printf("%ld", ftell(fp));

return 0;
}

Output

81

rewind() in C
The rewind() function is used to bring the file pointer to the beginning
of the file. It can be used in place of fseek() when you want the file
pointer at the start.

Syntax of rewind()

rewind (file_pointer);

Example

// C program to illustrate the use of rewind


#include <stdio.h>

int main()
{
FILE* fptr;
fptr = fopen("file.txt", "w+");
fprintf(fptr, "Geeks for Geeks\n");

// using rewind()
rewind(fptr);

// reading from file


char buf[50];
fscanf(fptr, "%[^\n]s", buf);
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that youprintf("%s", buf);
have read and understood our Cookie Policy & Privacy Policy Cookies are not
collected in the GeeksforGeeks mobile applications.
return 0;
}
Output

Geeks for Geeks

More Functions for C File Operations


The following table lists some more functions that can be used to
perform file operations or assist in performing them.

Functions Description

fopen() It is used to create a file or to open a file.

fclose() It is used to close a file.

fgets() It is used to read a file.

fprintf() It is used to write blocks of data into a file.

fscanf() It is used to read blocks of data from a file.

getc() It is used to read a single character to a file.

putc() It is used to write a single character to a file.

It is used to set the position of a file pointer to a mentioned


fseek()
location.

ftell() It is used to return the current position of a file pointer.

rewind() It is used to set the file pointer to the beginning of a file.

putw() It is used to write an integer to a file.


We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our Cookie Policy & Privacy Policy Cookies are not
getw() It isGeeksforGeeks
collected in the used to readmobile
an integer from a file.
applications.
Learn in a distraction-free environment with refined, high-quality
content and 35+ expert-led tech courses to help you crack any
interview. From programming languages and DSA to web development
and data science, GeeksforGeeks Premium has you covered!

Choose GeeksforGeeks Premium today and also get access to


Unlimited Article Summarization, 100% Ad free environment, A.I. Bot
support in all coding problems, and much more. Go Premium!

GeeksforGeeks 210

Next Article
C fopen() function with Examples

Similar Reads

C | File Handling | Question 1


Which of the following true about FILE *fp (A) FILE is a keyword in C for
representing files and fp is a variable of FILE type. (B) FILE is a structure…
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
1 minthat
acknowledge read
you have read and understood our Cookie Policy & Privacy Policy Cookies are not
collected in the GeeksforGeeks mobile applications.

C | File Handling | Question 2


When fopen() is not able to open a file, it returns (A) EOF (B) NULL (C)
Runtime Error (D) Compiler Dependent Answer: (B) Explanation: fopen()…
1 min read

C | File Handling | Question 3


getc() returns EOF when (A) End of files is reached (B) When getc() fails
to read a character (C) Both of the above (D) None of the above Answer:…
1 min read

C | File Handling | Question 4


In fopen(), the open mode "wx" is sometimes preferred "w" because. 1)
Use of wx is more efficient. 2) If w is used, old contents of file are erase…
1 min read

C | File Handling | Question 5


fseek() should be preferred over rewind() mainly because (A) rewind()
doesn't work for empty files (B) rewind() may fail for large files (C) In…
1 min read

Bank account system in C using File handling


This article focuses on how to create a bank account system using C
language and File handling in C. Approach:Let's discuss the approach in…
12 min read

ATM using file handling in C++


In this article, the task is to implement an ATM with functions like add,
delete, search, and update users using file handling in C++. File handling…
6 min read

Four File Handling Hacks which every C/C++ Programmer shoul…


We will discuss about four file hacks listed as below- Rename - Rename a
file using C/C++Remove – Remove a file using C/C++File Size - Get the…
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
3 min read
acknowledge that you have read and understood our Cookie Policy & Privacy Policy Cookies are not
collected in the GeeksforGeeks mobile applications.

C | Pointer Basics | Question 1


What is the output of following program? # include <stdio.h> void fun(int
x) { x = 30; } int main() { int y = 20; fun(y); printf("%d", y); return 0; } (A) 30…
1 min read

C | Pointer Basics | Question 2


Output of following program? # include <stdio.h> void fun(int *ptr) { *ptr =
30; } int main() { int y = 20; fun(&y); printf("%d", y); return 0; } (A) 20 (B) 30…
1 min read

Article Tags : C Language C-File Handling

Corporate & Communications


Address:- A-143, 9th Floor, Sovereign
Corporate Tower, Sector- 136, Noida,
Uttar Pradesh (201305) | Registered
Address:- K 061, Tower K, Gulshan
Vivante Apartment, Sector 137,
Noida, Gautam Buddh Nagar, Uttar
Pradesh, 201305

Company Languages
About Us Python
Legal Java
In Media C++
Contact Us PHP
Advertise with us GoLang
GFG Corporate Solution SQL
Placement Training Program R Language
We use cookiesGeeksforGeeks
to ensure you Community
have the best browsing experience on our website. ByTutorial
Android using our site, you
acknowledge that you have read and understood our Cookie Policy & Privacy PolicyArchive
Tutorials Cookies are not
collected in the GeeksforGeeks mobile applications.
DSA Data Science & ML
Data Structures Data Science With Python
Algorithms Data Science For Beginner
DSA for Beginners Machine Learning
Basic DSA Problems ML Maths
DSA Roadmap Data Visualisation
Top 100 DSA Interview Problems Pandas
DSA Roadmap by Sandeep Jain NumPy
All Cheat Sheets NLP
Deep Learning

Web Technologies Python Tutorial


HTML Python Programming Examples
CSS Python Projects
JavaScript Python Tkinter
TypeScript Web Scraping
ReactJS OpenCV Tutorial
NextJS Python Interview Question
Bootstrap Django
Web Design

Computer Science DevOps


Operating Systems Git
Computer Network Linux
Database Management System AWS
Software Engineering Docker
Digital Logic Design Kubernetes
Engineering Maths Azure
Software Development GCP
Software Testing DevOps Roadmap

System Design Inteview Preparation


High Level Design Competitive Programming
Low Level Design Top DS or Algo for CP
UML Diagrams Company-Wise Recruitment Process
Interview Guide Company-Wise Preparation
Design Patterns Aptitude Preparation
OOAD Puzzles
System Design Bootcamp
Interview Questions

School Subjects GeeksforGeeks Videos


Mathematics DSA
Physics Python
Chemistry Java
Biology C++
We use cookies to ensure
Socialyou have the best browsing experience on our website.
Science By using our site, you
Web Development
acknowledge that you have
English read and understood our Cookie Policy & Privacy
Grammar Policy
Data Cookies are not
Science
collected in the GeeksforGeeks mobile applications.CS Subjects
Commerce
World GK
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved

We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our Cookie Policy & Privacy Policy Cookies are not
collected in the GeeksforGeeks mobile applications.

You might also like