C Programming20795 marksInput Output Operations in File
Suppose a file named 'Num.txt' contains a list of integers. Write a program to extract the prime numbers only from that file and write them on 'Prime.txt' file.
Suppose a file named 'Num.txt' contains a list of integers. Write a program to extract the prime numbers only from that file and write them on 'Prime.txt' file. [5]
- Read integers from Num.txt using fscanf() - Check each integer for primality using a loop - Write prime numbers to Prime.txt using fprintf() - Use FILE pointer and formatted I/O --- --- Step Description ------------------- fopen("Num.txt", "r") Opens Num.txt in read mode; returns FILE pointer f...