0% found this document useful (0 votes)
48 views

C Is Portable: This Means A Program Written For One Computer May Run Successfully On Other Computer Also

The document provides an introduction to the C programming language. It discusses that C was created in 1972 by Dennis Ritchie at Bell Labs to overcome the problems of different architectures requiring different languages. C combines elements of BCPL and B and is considered a middle-level language as it is high-speed like low-level languages but relatively easy for humans to understand like high-level languages. The document then lists some key advantages of C like portability, speed, compactness, and simplicity. It also discusses C variables, data types in C including fundamental types like integer, float, character, and derived types, and constants in C.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views

C Is Portable: This Means A Program Written For One Computer May Run Successfully On Other Computer Also

The document provides an introduction to the C programming language. It discusses that C was created in 1972 by Dennis Ritchie at Bell Labs to overcome the problems of different architectures requiring different languages. C combines elements of BCPL and B and is considered a middle-level language as it is high-speed like low-level languages but relatively easy for humans to understand like high-level languages. The document then lists some key advantages of C like portability, speed, compactness, and simplicity. It also discusses C variables, data types in C including fundamental types like integer, float, character, and derived types, and constants in C.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Showing newest posts with label Introduction to C Language.

Show older posts


Showing newest posts with label Introduction to C Language. Show older posts

Introduction to C Language

The C Language is one of the most powerful language. In the beginning due
to the different architectures available, the programmer had to learn different
languages to create different types of applications. To overcome this problem
in 1972, Dennis Ritche at theAT & T Bell Laboratories, USA developed C
Language.

It is a combination of BCPL and B Language. The problem with Low Level


Languages is that they are very difficult for the humans to understand and
developed. On the other hand, High Level Languages are easy for the
humans to understand but slow in speed.

The C Language is high speed and easy to understand, so it is also term as


Middle Level Language.

Advantages of C

C is Portable
This means a program written for one computer may
run successfully on other computer also.

C is fast
This means that the executable program obtained
after compiling and linking runs very fast.

C is compact
The statements in C Language are generally short but
very powerful.
Simple / Easy
The C Language has both the simplicity of High Level
Language and speed ofLow Level Language. So it is
also known as Middle Level Language

C has only 32 Keywords

C Compiler is easily available

C has ability to extend itself. Users can add their own


functions to the C Library
VARIABLES

It is the name given to stored reason of the memory and it provides us the facility to change the
value of it during the execution. Variable names are the name given to the location in memory of
a computer where different values are stored. The location which contains these constants can be
an integer, character, real numbers.

DECLARE VARIABLE

When we want to declare any variable, then we decide that what is a data type of the variable?
And how it should declare? Variable can eight characters long only.

DATA TYPES

Data types can be represented in variety of ways in any programming language, so that we can
store data in system. C language provides us the way to hold any type of data in it. It is called
data type. In C language data types are classified into two categories:-

1. Fundamental data type

2. Derived data type


Fundamental Data Type

These can be represented on the particular machine and these are provided by every language
because without using data types we can’t save our data and can be called as storage media.

Derived Data Type

These are those data types which are consisting of combination fundamental data types

DFUNDAMENTAL DATA TYPES

Integer data type

It is a data type which is used to hold data in whole number e.g. 40, 4, 97, 80 and its range is
from -32768 to 32767. When we want to use integer data type, we have to specify “int” keyword.
It takes two bytes in memory and the conversion specifier is %d.

Float type

This data type is used to store fractional numbers or these numbers are also called real numbers.
In simple language we can say, this data type contains decimal value upto six decimal places.
When we use decimal values to store then we can use it.

e.g. 49.797, 79718.80

it can hold either positive or negative value with or without decimal the conversion specifier
used for float is %f. the range of float is -3.4*10-38 to 3.4*1038. it consumes 4 bytes in memory.

Character data type

This data type is used to store character enclosed in a pair of single quotes. E.g. ‘A’, ‘B’, ‘a’or
even a blank space can be used as a character. This data type contains one byte on memory and
the conversion specifier is %c.

STRING

We can also store number of characters in char data type within the range of -128 to 127. so
when we store number of characters in char data type then it is converted into string data type.
And we use conversion specifier %s.

Double data type

This data type is also used to store real type numbers and the keyword “double’ is used. It can
hold values upto 16 decimal places and it consumes 8 bytes of memory. The conversion specifier
is %lf. Its range is from 1.7*10-308 to 1.7*10308.
Long type

It contains whole number bigger than integer value is much bigger than integer. It consumes 4
bytes of memory and its range is from -2147483648 to 2147483647. Its conversion specifier is
%l. e.g. 247894, 4774863.

Boolian

This data type is used in relational operators. It gives us result in true or false. If the output is
false it returns to zero (0) and if output is true it returns to one (1). Its range is from 0 to 1 and it
has not any conversion specifier.

CONSTANTS

A constant represents that what a value is stored in it cannot be changed anytime. We use “const”
keyword for declaring any variable as constant. This keyword is a guideline to a compiler that
the value of variable is not changeable at any time during the execution of the program.

You might also like