C++ Write a program that prompts for a file name and then readsthe file to check for balanced curly braces, {; parentheses, ();and square brackets, []. Use a stack to store the most recentunmatched left symbol. The program should ignore any character thatis not a parenthesis, curly brace, or square bracket. Note thatproper nesting is required. For instance, [a(b]c) is invalid.Display the line number the error occurred on.
These are a few of the files that will be called, each namedinput1.cpp, input2.cpp and so on until input6.cpp – They aren’timportant to the code, just files to be checked.
input1.cpp
#include <iostream>
using namespace std;
void
OR
OR