How to Open Console with C++ Code

This is the simple but unique way to open the Command prompt mode. The C++ code enables the CMD mode to run the C++ program. We can also open CMD by just going to Start--> in run type "CMD" --> cmd.exe will appear in the list click and open but here we do it with C++ code.

Source Code 

#include "stdafx.h"
#include <iostream>
using namespace std;
int main()
{
cout<<"\a\n\n\n"
<<"\t******************************************************"<<endl
<<"\t** **"<<endl
<<"\t** Welcome To **"<<endl
<<"\t** Open new Console **"<<endl
<<"\t** Demo **"<<endl
<<"\t** **"<<endl
<<"\t******************************************************"<<endl<<endl<<endl;cout<<"";

system("pause");
system("start cmd.exe");
system("pause");

return 0;
}

Output of the Program

Open Console with C++ Code

Share on Google Plus

About Asad

Asad Niazi is Software Engineer , Programmer, Web Developer and a young mentor of BloggersTown and PProgramming. Asad Love to writes about Technology, Programming, Blogging and make money online.

1 comments: