Install Termux App
apt update && apt uprade -y
We have to install the nano text editor to write our code.
apt install -y nano
Clang Installation.
apt install -y clang
Create a file.
nano hello-world.c
or
nano hello-world.cpp
Write your code.
#include <stdio.h>
int main() {
// printf() displays the string inside quotation
printf("Hello, World!");
return 0;
}
write ctrl o
to save ur code simply press esc then type
The code is ready to compile
type
clang hello-world.c -o hello-world
It will compile; or it will show error. If it errors you have to fix it.
Now you have to make the file executable.
chmod u+x 0777 hello-world.c
To run your program type
./hello-world