History of C Programming Language: Laboratories" of USA in 1972
History of C Programming Language: Laboratories" of USA in 1972
·2 This language was created for a specific purpose : to design the UNIX
operating system (which is used on many computers).
·3 Many of its principles and ideas were taken from the earlier language
B
·5 As many of the features were derived from “B” Language thats why
it was named as “C”.
·7 Today's most popular Linux OS and RBDMS MySQL have been written
in C.
* C Programs are portable i.e they can be run on any Compiler with
Little or no Modification.
3 . Powerfull
What is Compiler ?
1. A computer program which reads source code and outputs assembly
code or executable code is called compiler.
2. A program that translates software written in source code into
instructions that a computer can understand Software used to translate the
text that a programmer writes into a format the CPU can use.
3. A piece of software that takes third-generation language code (machine
code executable from assembly code) and translates it into a specific assembly code.
Compilers can be quite complicated pieces of software.
Step 2 : Compiling
1. Compiling C Program : C Source code with [.C] Extension is given as input
to compiler and compiler convert it into Equivalent Machine Instruction.
2. In Borland C/C++ 3.0 program can be compiled using key [Alt + F9 ].
3. Compiler Checks for errors . If source code is error-free then Code is
converted into Object File [.Obj ].
Type of Languages :
Low Level Language
Middle Level Language
High Level Language
What is Low level Language in Computer Science ?
·9 Machine understandable Language.
Comments in C :
Single Line Comment in C Programming:
Comments are non-executable code used to provide documentation to
programmer. Single Line Comment is used to comment out just Single Line
in the Code. It is used to provide One Liner Description of line.
Some Importatnt Points :
·24 Single Line Comment Can be Placed Anywhere
Example :
#include<stdio.h>
void main()
{
printf("Hello"); //Single Line Comment
printf("By");
}
Multi Line Comment in C Programming:
Some Importatnt Points :
·27 Multi Line Comment Can be Placed Anywhere.
·30 Any Symbols written between ‘/*’ and ‘*/’ are ignored by Compiler.
Example :
#include<stdio.h>
void main()
printf("Hello");
/* Multi
Line
Comment
*/
printf("By");
/****************************************
***************************************/
Hiding Code using Comments :
Single Line Comments are useful where you need to comment or hide two-
three words however multiple line comments are useful where you want to
hide multiple lines of code.
/*
for(i=0;i<num;i++)
scanf("%d",&arr[i]);
*/
i.e Suppose we want to hide multiple lines then instead of using single line
comment before each line we can use multiple line comment.
for(i=0;i<num;i++)
scanf("%d",&arr[i]);
// i++;
########################################################################
###############################################Variables and Constants