2. What is language
If we talk about the language, any type of language so an idea is come in your mind which
is, anything which we think and we can express, by language. Or we can say language is a
way of expressing your ideas. C language is same to other natural language (like English)
which we learn. It is also one-way communication, in which computer user communicate
with computer.
3. History of C language
Before becoming C language, there
was a language Basic Combined
Programming language, (BCPL). It is a
programming language developed by
Martin Richards in 1966. They created
this language by combining many
features of languages.
Ken Thompson improve the BCPL
language and used the first letter of
BCPL language which is known as B
language. And C is also created by
improving B language.
4. INTRODUCTION TO C LANGUAGE
C language is a medium to interact with computer. The C language was developed by -
โDennis Ritchieโ at the AT&Bell telephone laboratories in 1972. First c language was
developed to write UNIX operating system. It is also made it for easier to move programs
between computer with different hardware. It is more flexible.
The C language was names C because its predecessor was named B. The B language was
developed by โKen Thompsonโ.
Most of the software are written in C language and UNIX operating system is also written in C
because of these reasons-
* Easy to learn
* Structured language
* It produces efficient program
* It can handle low-level activities
* It can be compiled on a variety of computer platform
5. Structure of C programs
๏ถ Before going to learn the structure of c programs first we need to have some basic
knowledge of the following:
๏ Cโs character set
๏ Keywords
๏ Data types
๏ Variables
๏ function
6. // Name of program Documentation section
#include<stdio.h> link section
#include<conio.h>
#define max Definition section
void add(); Global declaration section
int x=10;
int main() main () function section/entry point
{ int a =10; variable declaration
printf(โHello mainโ);
return 0; body of main function
}
void add() {
printf(โHello addโ); function declaration
}
A C program involves the following sections
7. Simple code of C โhello worldโ program
// simple hello world C code
#include<stdio.h>
#include<conio.h>
void main()
{
printf("Hello, World!n");
return;
}
8. Data types
C language supports the following basic data types:
๏ int: integer, a whole number.
๏ float: floating point , a number with a functional part.
๏ double: double โprecision floating point value.
๏ Char: single character.