How to Write and Run C++ Programs in Termux

1) Open the Termux and type 'nano' to open nano. $ nano 2) Now type C++ program which you want to run 3) After typing the C++ program , t



Anonymous School 🏫

            (Minds of Hacker)

----------------------

        
        Hello friends Welcome to Anonymous School 🏫. This is 28th part of Ethical Hacking With Android Course . In this post i show you can we write and run C++ programs in Termux. Then please read the full post.







How to Write and Run C++ programs in Termux :-


Requirements :-

1. Termux Apk  ( Click Here to Download  ).

             OR

2. Kali Linux

            OR

3. Kali Nethunter file  ( Click Here to Download ).

4. Nano  ( Click Here to Download )


            So , Firstly we need to write a C++ program and then we need run program file. Then for writing program we need one tool, which is Nano.  I already posted a 1 post on nano , where i explained how to install it & how to use it. Then please Click Here and go to this post to see how to install & use nano .

            Then for compiling and running program we need a one more tool ,that we see below. The name of this tool is Clang .

            Now follow the following steps :-

1) Open the Termux and type 'nano' to open nano.

$ nano



2) Now type C++ program which you want to run.


3) After typing the C++ program , type the CTRL button and x to save this file.


4) Then it asks that you want to save it then type Y .

5) Then type the name for your file and give extension .cpp , then press enter. After that your file will be saved.

6) Now we need to run this program file , then for that we need to install Clang tool for that type following command.

$ apt install clang

7) Now to compile your program file type Clang then space then type name of program file.

$ clang++ programfile.cpp



8) After that command 1 output file will be generated with name a.out .

9) Now we need to run this file to get output, then to run this file type ./ then type a.out without space

$ ./a.out



10) After this command you can see output of your program .




             So Friends, in this post i showed you how we can write or run C++ programs in Termux. Then please follow to this blog & subscribe to our YouTube channel . If you want to see it practically then visit to our YouTube channel .





Note 📝 :-
1) While copying the commands from this blog don't copy $ this symbol, because this symbol is only for mentioning that this is the command, then don't copy this symbol , else you get a error.

 ****************Don't Make Learning Hard*****************

  Follow Us  



NextGen Digital... Welcome to WhatsApp chat
Howdy! How can we help you today?
Type here...