Hello There, Welcome to Think & Free. Here is the brand new series of Express Learning Programming. In this series, I’m going to talk about the GNU C Programming language. Let’s begin This is an Introduction to C Programming, today I will talk about these topics.
- What is the GNU C Programming Language?
- How to Start Programming With C.
- C Program Structure & Program Syntax.
In this post, I will talk about step by step these topics. First, let’s see What the GNU C Programming Language is.
WHAT IS THE GNU C PROGRAMMING LANGUAGE
GNU C is a general-purpose, Cross-platform, structured, high-level computer programming language. It was originally developed at Bell Labs by Dennis Ritchie. This Language Developed for building Unix Utilities.
HOW TO START PROGRAMMING
C is a compiled language. This type of language will first convert their source codes into machine language instructions. To do that they used a program called a Compiler. The compiler can convert source codes into machine language instructions. compiled instructions can be different between Operating systems or CPUs. The reason is all CPUs and Operating Systems didn’t use the exact instructions.
Before, Starting to create a Program using C Language, we need to set up a compiler on our system. GNU GCC Compiler is an official Compiler to do that. Let’s install the GNU GCC Compiler on our system.
For Linux
In Linux Systems, follow the system package manager to install the latest version of the GCC Compiler. Or Follow the instructions in the GNU GCC Official installation document.
For Windows
In Microsoft Windows Systems, We can use MinGW Environment. MinGW included GCC Compiler. If you are a Microsoft Windows user you can get the MinGW setup executable binary via the MinGW Official web page.
For Mac Users
Mac users can get a copy of the GNU GCC Compiler source code and they can manually build a binary and install it. Another way is Mac users can use the homebrew package manager to install GCC on their Mac system. The command is given below.
brew install gcc
PROGRAM STRUCTURE/SYNTAX
This picture gives the basic structure of a C program. In the first line, “#include <stdio.h>
“, We can see a Header file including statements or including the preprocessor command header section. “#include
” is used to, include a c header file into the program. In future lessons, I will explain everything about these headers.
int main() is the entry point of every C program. it is the main function of the C program. all functions must call on this main function. after creating the main function, the main function will start with “{
” and end with “}
“. we must input all statements in this block.
In the main function first, we can see “int i;
” int means, it is some datatype of c. and “i
” was an identifier to defining a variable. future I will talk about that. In the second line, we can see “// Asking user for value
“, that is the way, to single-line comment in C. Next line printf("Enter a value");
. printf()
, is a C function, used to print out some string or any object in C. scanf()
and getch()
are another c functions. scanf()
used to read user inputs. don’t think about that in future I will talk about that.
return 0;
this is another main part of a C program return statement that will indicate the program or returning value or end state type. this is the main structure of the C Program.
Related: Constants in C
That’s it, For this Introduction to C Programming Tutorial. See you soon with another episode of this series. Leave a comment, and tell your ideas, and questions in the comments.
Good Web site
Thanks bro
Good article
Congratulations
Good