C Language
-
Upload
manish-goyal -
Category
Documents
-
view
8 -
download
1
description
Transcript of C Language
C LANGUAGEMADHUVAN TECHNOLOGIES
WHAT IS COMPUTER LANGUAGE?
The term computer language includes a wide variety of languages used to communicate with computers.
The way by which we pass the instruction to the computer is called computer language
Computer languages can be divided into two groups: High Level
Procedure Oriented Object Oriented
Low Level Machine Language Assembly Language
WHAT IS PROGRAM ?
Program: A Computer program is a set of instructions that are
followed to solve some problem.
Instruction A single instruction to computer that directs
computer to perform a unique task is called Instruction.
Programming The action of writing computer program is called
programming.
PROCEDURE ORIENTED Procedure oriented programming basically consists of
writing a list of instructions(or actions) for the computer to follow, and organizing these instructions into groups known as functions.
In a multi-function program, many important data items are placed as global so that they may be accessed by all functions.
Global data are more vulnerable to an inadvertent change by a function.
In a large program it is very difficult to identify what data is used by which function.
OBJECT ORIENTED Object-oriented programming (OOP) is a programming
language model organized around "objects" rather than "actions" and data rather than logic.
INTRODUCTION TO C LANGUAGE C is a general purpose high level language that was
originally developed by Dennis M. Ritchie to develop the Unix operating system at Bell Labs. C was originally first implemented on the DEC PDP-11 computer in 1972.
The C has now become a widely used professional language for various reasons Easy to learn Structured language It produces efficient programs. It can handle low-level activities. It can be compiled on a variety of computer platforms.
WHY USE C? C was initially used for system development work, in
particular the programs that make-up the operating system. C was adopted as a system development language because it produces code that runs nearly as fast as code written in assembly language. Some examples of the use of C might be:
Operating Systems Language Compilers Assemblers Text Editors Print Spoolers Network Drivers Modern Programs Data Bases Language Interpreters Utilities
DATA TYPES IN C Data type specify the type of Data: C has a rich set of data types as follows
VARIABLES IN C A variable is nothing but a name given to a storage area
that our programs can manipulate. Each variable in C has a specific type, which determines
the size and layout of the variable's memory; The name of a variable can be composed of letters,
digits, and the underscore character. Syntax
type variable_list; Example
int i, j, k; char c, ch; float f, salary; double d;
CONDITIONAL STATEMENTS Decision making structures require that the programmer specify
one or more conditions to be evaluated or tested by the program,
Following is the general from of a typical decision making structure found in most of the programming languages
CONDITIONAL STATEMENTS
LOOPING STATEMENTS There may be a situation when you need to execute a block of
code several number of times. A loop statement allows us to execute a statement or group of
statements multiple times and following is the general from of a loop statement in most of the programming languages:
LOOPING STATEMENTS C programming language provides following types of loop to
handle looping requirements
LOOPING STATEMENTS C programming language provides following types of loop to
handle looping requirements.
Every C program has at least one function which is main(), and all the most trivial programs can define additional functions.
A function can be called many number of times.
Definition:Return_type function_name( parameter list ) {
body of the function }