What is C ?
C is a general-purpose, imperative computer programming language, supporting structured programming, lexical variable scope and recursion, while a static type system prevents many unintended operations.
Open Termux app and type following commands
$ pkg install clang
$ pkg install nano
To write your c program type
$ nano filename.c
Hello world program in c :
#include <stdio.h>
int main()
{
printf("Hello, World!");
return 0;
}
To compile your c program type
$ gcc filename.c -o aliasname
Example : gcc hello.c -o h
To run your c program type
$ ./aliasname
Example : ./h
What is C++??
C++ is the general programming language almost everybody learns in their early programming days to build up a strong understanding of basic programming concepts. It is still a popular programming language in the programming language family. Many languages like JAVA and C# have been influenced by Cplusplus.
How to install C++ ?
Open Termux app and type following commands
$ pkg install clang
OR
$ pkg install g++
$ pkg install nano
To write your c++ program type
$ nano filename.cpp
Hello world program in c++
#include <iostream> using namespace std; int main() { cout << "Hello, World!"; return 0; }
To compile your c++ program type
$ g++ filename.cpp -o aliasname
Example : g++ hello.cpp -o h
To run your c++ program type
$ ./aliasname
Example : ./h
No comments:
Post a Comment