This is a program that I have to make please somebody help me

The purpose of the task is to implement a program that reads the contents of a text

file (in.txt) and if it qualifies for an arithmetic expression set out below,

perform the specified arithmetic operation and record the results in a binary file (out.dat).

Arithmetic expression must meet the following conditions:

• is enrolled in a row;

• consists of two integer operands separated by the sign of arithmetic operation;

• arithmetic operations are permitted: "+" and "-";

• there is allowed an unlimited number of whitespace (space - '' and

char - '\ t') before and after the sign for simple operation;

• there is allowed an unlimited number of whitespace at the beginning and end of

arithmetic expression.

Example:

in.txt: "158 + 7"

out.txt: Contains binary written the number 165

Thanks

The code I have written for now is:

Code:#include<stdio.h> int main() { FILE *fp; int c; char h; fp = fopen("sample.txt", "r"); if(fp == NULL) { printf("Input file not found!"); return 1; } while (EOF != (c = fgetc(fp))) printf("%c", c); return 0; }