 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you the use of getW and putW functions for reading and writing integers into a file in C programming. Before starting, you can note how you can search my YouTube channel. You can type my name Sanjay Gupta in YouTube. My channel will be available there. You can watch various programming related videos here. So here two functions are available, getW and putW. GetW reads integers from file and putW writes integer into a file. So for demonstration purpose, I have included two header files, std.h and stdlib.h. Then main function is implemented. Here file pointer fp is declared. After that, two variables of integer type are declared n1 and n2. Then fp equals to fopen. fopen function is called which is opening number.txt file in write mode. Then if condition will be checking whether file is opened successfully or not. So if file pointer is equals to null, then this printf error message will be displayed on output screen and through exit, execution of program will be terminated. If this condition falls, then remaining statements which are available after if condition will be executed. Then you can see printf will be displaying a message enter an integer value on output screen. The entered number from user will be stored inside n variable and that is received through scanf. So printf scanf will be reading a number from user. Now putW, this putW writes an integer into a file. So number is available in n variable and that number will be stored inside fp. fp is opening number.txt. So number will be stored in number.txt file. Now after writing the number successfully, I am closing the file. Here I am writing n1 instead of n because I have declared two variables n1 and n2. So after closing this file, if I want to read that number, I have to reopen this file. So for that purpose, I have called fopen function again and this time I am opening this file in read mode. So here again I have to check whether file is opened successfully or not. So this way the error message will be displayed and exit will terminate execution of the program. After that, getW function will be receiving a number which is available in file through fp and that number will be stored inside n2. That number will be printed back on output screen with the help of n2 and using printf statement. So I am writing this value equals to % and n2 and then I am closing fp. So this way through n1 variable, I have stored the number into file using putW function and then through getW function, I have received that stored number into n2 variable. So the number which is available inside n1 will be stored in file. Through file that number will be stored into n2 and then through n2 it will be again printed on output screen. Now I am going to execute this code. You can see it is asking for a number enter an integer value. So I am entering 22. You can see it is showing value equals to 22. So the number 22 which I have entered is received through n1 and the value equals to 22 is printed through n2. So this is done with the help of getW and putW function. PutW is writing integer into file and getW leads a number from file. So this way I have demonstrated you the use of getW and putW functions. I hope you have understood how this program is working. If you want to watch more programming related videos, you can search my name Sanjay Gupta in YouTube. My channel will be available there. You can watch various programming related videos there. Thank you for watching this video.