Programming I - L1
Programming I - L1
The System
The Flow
Programming language
Why Programming
C-
It is the basic, middle-level programming language having a simple set of keywords that are used to develop moderate-level applications.
C is the best means to step into the programming world, especially for beginners.
C++-
Foremost programming language taught in the education institutes. An extension of the C language, that allows developers to code for
middle-level applications such as- graphics, office applications, games, and video editors.
PHP–
PHP Development is a popular general-purpose programming language that is particularly suited to web development. It is quite fast,
easy to learn, flexible and pragmatic additionally PHP controls everything from your blog to the utmost popular websites in the world. It
can be used to develop an application to create dynamic page content.
.NET-
It is a free, cross-platform, open-source developer platform used to build several kinds of applications. For developers, the .NET
Framework delivers a broad, wide-ranging and reliable programming language which is used for building applications that have visually
spectacular user experiences and smooth and secure communication. Different applications (for- mobile, desktop, IoT, gaming, web) can
be developed with the help of .Net because it uses several different languages, libraries, editors.
HTML–
It is the standard markup language used to design documents for a web browser. Through this, developers can easily format text and
images. CSS and JavaScript work as the helping hands for HTML developers.
Programming
Flutter–
It is an open-source framework developed by Google to craft high-quality native interfaces such as- diverse mobile
applications. The application developed by Flutter gives better performance because there’s no JS bridge.
ReactJS–
Also named as React.js. It is a JavaScript library used to create user interfaces. Mainly, it is used to develop single-
page applications or web pages. This is an excellent option for fetching quickly changing data.
React Native–
It is an open-source mobile application framework developed by Facebook after the launch of React. Developers
can easily develop applications for iOS, Web, Android, and UWP by using the React along with the Native
platform.
Vue.js–
It is an MIT-licensed open-source framework for developing user interfaces. As per the use and need the library and
framework can be scaled up easily. It is well known for its speed.
Node.js–
It is a cross-platform, open-source, JavaScript run-time environment that executes JavaScript code outside of a
browser. Node has the ability to manage thousands of connections simultaneously with a single server.
C : The journey
In 1972, Dennis Ritchie was at Bell Labs, where a few years earlier, he and his fellow team
members invented Unix.
After creating an enduring OS (still in use today), he needed a good way to program those
Unix computers so that they could perform new tasks.
Few programming languages were available; Fortran, Lisp, Algol, and B were popular but
insufficient for what the Bell Labs researchers wanted to do.
Demonstrating a trait that would become known as a primary characteristic of
programmers, Dennis Ritchie created his own solution.
He called it C, and nearly 50 years later, it's still in widespread use.
Structure of C program
First Program
First program
// hello.c
#include <stdio.h>
int main()
{
printf("Hello world\n");
return 0;
}
$ ./hello
Hello world
$
Printf() essentials
Compile a C Program
$ gcc [options] [source files] [object files] [-o output file]
$ gcc -Wall -save-temps hello.c --output hello
Ref: https://www.rapidtables.com/code/linux/gcc.html
gcc options
option description
Removal of Comments
Expansion of Macros
Expansion of the included files.
Conditional compilation
For addition program
Comments are stripped off.
#include<stdio.h> is missing instead lots of code added. So header files has been expanded and included
in the source file.
Compilation
compile filename.i and produce an intermediate compiled output file filename.s.
This file is in assembly level instructions.
Assembly
Final phase in which all the linking of function calls with their definitions are done.
Linker knows where all these functions are implemented.
Linker adds some extra code to the program which is required when the program starts and
ends.
For example, there is a code which is required for setting up the environment like passing
command line arguments.
This task can be easily verified by using $size filename.o and $size filename.
Learning C
First Program
Thank You