Hello guys,
How are you?
After a very long period I just come back to my favourite blogging platform hive. I have a plan to start a basic tutorial on computer programming language "ANSI C" on hive, which I've already started on steemit platform. But, I want share my tutorial not only on steemit, but, also on hive community. So, I just started here--
Actually, "C" is the most popular & easy to learn, more efficient & fast, high-level computer programming language. If you learn "C" very well then you can do learn any programming language within one month. So, it's called "C" language is the base of all programming language.
What is "C" ?
"C" is the next & modified version of programming language "B". What is "B" ? "B" means "BCPL(Basic Combined Programming Language)" which was developed at Cambridge University in the year of 1960. Later in the year of 1972, "B" was heavily modified by Dennis Ritchie (a computer scientist worked at Bell Laboratories). Dennis Ritchie renamed this modified version of "B" to "C".
Unlike many other languages "C" is completely machine independent; it means if you write a program in C for one computer, it'll be run on another computer on different OS(operating system) without any modification. "C" is not object-oriented language like "C++" is. It's called Procedural Oriented language. Actually, any program written in C is basically a set of functions which are defined in C library.
What are we learning here?
C Data Types, Variables & Constants, Keywords & Identifiers
C Operators & Expressions
Management of Input/Output (I/O) Operators
Decision Making & Structuring
Decision Making & Looping
Functions Handling
One-dimensional , Two-dimensional & Multi-dimensional Arrays
Character Strings Handling
Pointers
File Handling & Operations
Structures & Unions
Dynamic Memory Allocation
Preprocessor & Header Files
An Example of C Program
Here I show you a simple program written in C language. In this program it calculates the sum of two integer numbers & show the result on the computer screen:
/* Sample Program Written in ANSI C */
/* This program shows how to calculate summation of two integer numbers & show the result on the screen*/
/* Written by @royalmacro */
#include <stdio.h>
#include <conio.h>
void main()
{
int number1, number2, sum; /*variable deceleration*/
clrscr(); /*Clear the whole screen*/
printf("Enter Number-1: ");
scanf("%d",&number1); /*number input*/
printf("Enter Number-2: ");
scanf("%d",&number2); /*number input*/
sum=number1+number2; /*calculat summation*/
printf("%d is the summation of %d & %d",sum,number1,number2);
getch(); /*wait until hit a key*/
}
After compiling & running this program it shows like below:
Sample Window-
Enter Number-1: 67
Enter Number-2: 33
100 is the summation of 67 & 33
Where I'll get C compiler ?
There many C compilers available, one of them "Turbo C++ version 3" is most popular. To get this compiler for Windows 7/8/10 (for both 32-bit & 64-bit operating system) check this following website. It's absolutely free.
If you do not want to download you can try online C compiler on tutorialspoint.
In the next episode we'll discuss about "Basic Structure of a C Program"
[To be continued...]
N.B. This tutorial was also published on my steemit blog (ID @royalmacro)