Is there a way by which I can login into router admin settings using c/c++?
I am thinking to make a program which logs into the router whenever is executed ?
If this is the case, the interface is over HTML/HTTP. So you can either do the comms yourself (sockets) or use a library (like boost). And then, there's the HTML request and result parsing.
Step 1: Nmap the target, see here https://nmap.org/download.html . Use -sO\-sV for a protocol scan to enumerate the services listening on the open ports that it finds.
Step 2A: Choose protocol from those listed that meets your needs. (Chances are that, if it is available, SSH will fit your requirements perfectly.)
Step 3: Design a framework rough sketch for the application you want to write based on the protocol you choose. Look into libraries such as cURL, libssh and Boost::ASIO for support.
Step 4: Let us know how it goes. This seems like an interesting project.