Skip to main content

Run C and C++ Program in Android using Termux

Run C and C++ Program in Android using Termux

Hello Friends, This is Suraj Giri from Technical Glamour  . In this Blog I have discussed about 
How to run C and C++ program in Android using Termux Terminal Emulator. I have installed Nano editor in Termux for writing source code and Clang Compiler for compile and run the program.

For visual understanding of How To Run C And C++ Program In Android Using Termux, Must watch this video. In this video each step is shown cleary with all common doubt solving


We know that to write programs we need an Editor. You must have listen about some well known editors to write codes. e.g VS Code, Nano, VI , Notepad++ etc. Generally Nano and VI editors are used in Unix based OS. So, In termux we can install anyone from both and by the way many more editors are also available for Unix OS to be used in termux. In this blog we will learn about Installation Process of Nano in Termux.

We must required a compiler to find bugs or error and to execute our codes. You must have listen about some well known compilers to execute the program. e.g Clang, gcc, tubo c++ etc. Generally gcc and clang compilers are used widely. In this blog we will learn about Installation Process of Clang in Termux.


So, let's discuss about the steps involves in Installing Clang Compiler and Nano Editor to run C and C++ Program in android. Follow the following steps to understand the process of installing nano editor and clang compiler in Android: 

Step 1Download the Termux Application from below link. Actually Termux is a terminal emulator which provides the environment of Linux in Android operating system. You can install lot's of hacking and testing tools using this and use as per your need. If you want to tutorial on Termux then comment below I will surely write an article on it. Download Termux from this link..

https://play.google.com/store/apps/details?id=com.termux

Step 2. Now open the termux and clear the screen using command "clrscr".Then write command "apt update && apt upgrade". It will update and upgrade, all the inbuilt tools of Termux.

Step 3. Now Install Nano using command "apt install nano"

Step 4. Now Install Clang usng command "apt install clang"

Now you have completed the important steps.

Following commands and points are useful in writing code, so learn it :

1) To create or modify any file ~ "nano file_name"

     >You can also simply write "nano" to open nano editor.

     >There are lot's of shortcut are given in nano home screen, so you can use it. Keep in mind this symbol '^' specify ctrl.

      >Must write file extension during saving to get syntax color of that language. Like .c for C, .cpp for C++ etc.

       >Save the file initially with appropriate extension, so you wil get the syntax color.

2) To Compile program of any file ~ "clang file_name" . You will get error on terminal if there  error in code else write ".\a.out" to execute the program.


I hope you got all my points. So, Thanking You for your time. See you next time.......




Comments

Popular posts from this blog

Install ExaGear Windows Emulator In Android Phone

 Hii Friends You must have used Typing Master software In your or your relative's Laptop or PC but have you listen about uses of windows softwares in Android Phone? Your answer may be yes or No but keep in mind that nothing is Impossible in the World of Technology. So Lets Begin There are lots of Windows Emulators are available but today we only discuss about one of the best Windows Emulator Application known as ExaGear. Actually Installation process of ExaGear Application is little complicated. So we understand it step by step... INSTALLATION PROCESS OF EXAGEAR Step 1: Download ExaGear Windows Emulator  zip file by following link    🔥🔥🔥 Download ExaGear Application with its Data link-- https://www.mediafire.com/file/7ik5ciqq91tn0qd/Exagear_android.7z/file Step 2:  Download Zarchiever app from play store  🔥🔥 Download ZArchiver App link-- https://play.google.com/store/apps/details?id=ru.zdevs.zarchiver Step 3: Open Zarchiever app and Select the downl...

Install DEV C++ In Android Phone

Hii Friends... This article is for those who don't have Laptop or PC and wanted to do programming in his or her android phone. In this article we will discusss about Installation Process of Dev C++ in Android Phone. Most of us know about Dev C++. If you don't know then Don't worry I am going tell about the same. DEV C++ is well known IDE for programming of c and c++ programming languages. It's one of the best IDE and having all modern features. It is a free fully featured Integrated Development Environment distributed among user under the GNU General Public License for programming in C and C++. Dev-C++ is a free IDE for Windows that helps reduce the manual work required when programming. It comes with a wide range of features such as an integrated debugger, class browser, automatic code completion, function listing, profiling support, customisable code editor, project manager, and pre-made templates for various projects, tools manager and many more. For Visual Understan...