C Language Basics

Introduction C Programming Language In Simple Words

C Programming

What  Exactly C Programming Language Is ?

A computer is an electronic device that manipulates information, or data. It has the ability to store, retrieve, and process data. You probably already know that you can use a computer to type documents, send email, play games, and browse the Web. You can also use it to edit or create  spreadsheets, presentations, and even videos.

Computer Consist of Hardware and Software

1. Hardware:

Hardware represents the physical components of a computer i.e. the components that can be seen and touched.

Examples of Hardware are following:

  • Input devices — keyboard, mouse etc.

  • Output devices — printer, monitor etc.

  • Secondary storage devices — Hard disk, CD, DVD etc.

  • Internal components — CPU, motherboard, RAM etc.

2. Software:

Software is a collection of instructions that enable the user to interact with a computer, its hardware, or perform tasks. Without software, computers would be useless. For example, without your Internet browser, you could not surf the Internet or read this page and without an operating system, the browser could not run on your computer.

Types of Software are ass follows,

1. Application Software

e.g: Application Packages, Special purpose software like Word, Excel and PowerPoint.

2. System Software:

OS, Packages(Linker, loader,editor),Translators(Compiler & Interpreter)

Communication Between User and Machine:

User want to interact with machine but machine only knows language in the form of 0’s and 1’s i.e. Bit (Binary Language)

So Binary language is also known as Machine level language but it is difficult to understand because it is in the form of bits. So user want language that is close to user and we know it as High level language .High level language is just like English language, all instructions are in friendly approach.

So, To convert Machine level language to High Level language and high level language to machine level language we need Translators. We will discuss now a translators.

Translators:

Programming languages (compiler or Interpreter) that converts a computer program written in one language to another at that time we need Translators.

Translators are of types

1.Compiler

2. Interpreter

      1. Compiler

        • Compiler Takes Entire program as input

        • Intermediate Object Code is Generated

        • Conditional Control Statements are Executes faster

        • Memory Requirement : More (Since Object Code is Generated)

        • Program need not be compiled every time

        • Errors are displayed after entire program is checked

        • Example : C Compiler

      1. Interpreter

  • Interpreter Takes Single instruction as input

  • No Intermediate Object Code is Generated

  • Conditional Control Statements are Executes slower

  • Memory Requirement is Less

  • Every time higher level program is converted into lower level program

  • Errors are displayed for every instruction interpreted (if any)

  • Example: Java

Need of C Language:

C is called as Middle level language. Behaves as High Level Language through Functions – gives a modular programming It gives access to the low level memory through Pointers As its a combination of these two aspects, its neither a High Level nor a Low level language ,so C is Middle Level Language.

History of C Language:

Developed at Bell Laboratories in 1972 by Dennis Ritchie.

Features were derived from earlier language called “B” (Basic Combined Programming Language – BCPL)which is developed by Ken Thompson in 1970’s.

Invented for implementing UNIX operating system

Features of C:

  • Simple

  • Mid-level programming language

  • Structured programming language

  • Rich Library

  • Fast Speed

  • Pointers

  • Recursion

  • Extensible

C programming Basic:

Each language is made up of two parts,

Vocabulary

Grammar

In programming language,

Vocabulary means Tokens

Grammar means Syntax

Tokens:

Tokens are basic building blocks of C Programming.

Tokens consist of Identifiers,Variables,Constants,Character Set,Keywords,Data Types,Operators.

 

No

Token Type

Example 1

Example 2

1

Keyword

do

while

2

Constants

number

sum

3

Identifier

-76

89

4

String

“HTF”

“PRIT”

5

Special Symbol

*

@

6

Operators

++

/

 

Token

Meaning

Keyword

A variable is a meaningful name of data storage location in computer memory. When using a variable you refer to memory address of computer

Constant

Constants are expressions with a fixed value

Identifier

The term identifier is usually used for variable names

String

Sequence of characters

Special Symbol

Symbols other than the Alphabets and Digits and white-spaces

Operators

A symbol that represent a specific mathematical or non-mathematical action

Example Of C Program:

#include<stdio.h>

 int main()
{
printf(“Hello World\n”);
return 0;
}
 

I’ll come with next tutorial soon with next article, so please revisit this blog soon, bye for now.

Leave a Reply

Your email address will not be published. Required fields are marked *