Welcome In The World Of ‘C’.  TEXT BOOK: Programming in ANCI ‘C By: E Balagurusamy. TMH  Reference Books: 1) The ‘C Programming Language By: Kernighan.

Slides:



Advertisements
Similar presentations
Agenda Definitions Evolution of Programming Languages and Personal Computers The C Language.
Advertisements

Fundamentals of Computer and programming in C Programming Languages, Programs and Programming Rohit Khokher.
Chapter 1: Introduction
Introduction to C Programming CE Lecture 1 Introduction to C.
CSE1301 Computer Programming Lecture 4: C Primitives I.
Three types of computer languages
Program Flow Charting How to tackle the beginning stage a program design.
Program Flow Charting How to tackle the beginning stage a program design.
Chapter 1 Introduction to C Programming. 1.1 INTRODUCTION This book is about problem solving with the use of computers and the C programming language.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages C++ Programming:
James Tam Creating Actual Computer Programs This section of notes describes how a computer program written by a person is translated to a form that can.
CMSC 104, Version 9/011 Introduction to C Topics Compilation Using the gcc Compiler The Anatomy of a C Program 104 C Programming Standards and Indentation.
C programming Language and Data Structure For DIT Students.
Introduction to C. A Brief History Created by Dennis Ritchie at AT&T Labs in 1972 Originally created to design and support the Unix operating system.
CHAPTER 1: INTORDUCTION TO C LANGUAGE
Programming In C++ Spring Semester 2013 Programming In C++, Lecture 1.
“C” Programming Language What is language ? Language is medium of communication. If two persons want to communicate with each other, they have to use.
Introduction to C Programming. A Brief History u Created by Dennis Ritchie at AT&T Labs in 1972 u Originally created to design and support the Unix operating.
Basics of “C” Programming
Hello World 2 What does all that mean?.
Introduction of C++ language. C++ Predecessors Early high level languages or programming languages were written to address a particular kind of computing.
Chapter 3: Completing the Problem- Solving Process and Getting Started with C++ Introduction to Programming with C++ Fourth Edition.
Programming With C.
History of C 1950 – FORTRAN (Formula Translator) 1959 – COBOL (Common Business Oriented Language) 1971 – Pascal Between Ada.
/* Documentations */ Pre process / Linking statements Global declarations; main( ) { Local Declarations; Program statements / Executable statements; }
Sharda University P. K. Mishra (Asst.Prof) Department of Computer Science & Technology Subject Name: Programming Using C Sub Code: CSE-106 Programming.
CMSC 104, Version 9/011 Introduction to C Topics Compilation Using the gcc Compiler The Anatomy of a C Program 104 C Programming Standards and Indentation.
INTRODUCTION TO COMPUTING CHAPTER NO. 04. Programming Languages Program Algorithms and Pseudo Code Properties and Advantages of Algorithms Flowchart (Symbols.
Computer Programming I Hour 2 - Writing Your First C Program.
Object-Oriented Program Development Using Java: A Class-Centered Approach, Enhanced Edition.
Algorithms  Problem: Write pseudocode for a program that keeps asking the user to input integers until the user enters zero, and then determines and outputs.
CHAPTER 1 INTRODUCTION 1 st Semester H King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1.
C programming language was developed in the seventies by a group of at the Bell Telephone lab. The C language was the outline of two earlier languages.
CHAPTER 1 INTRODUCTION 2 nd Semester H King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1.
Introduction to C CMSC 104, Section 4 Richard Chang 1.
DOCUMENTATION SECTION GLOBAL DECLARATION SECTION
Agenda Computer Languages How to Write a Simple C Program
Introduction to C Programming Language. History of C  C was evolved by Dennis Ritchie at AT&T Bell Laboratories in early of 1970s  Successor of: ALGOL.
Chapter 11  Getting ready to program  Hardware Model  Software Model  Programming Languages  Facts about C++  Program Development Process  The Hello-world.
An overview of C Language. Overview of C C language is a general purpose and structured programming language developed by 'Dennis Ritchie' at AT &T's.
Evolution of C and C++ n C was developed by Dennis Ritchie at Bell Labs (early 1970s) as a systems programming language n C later evolved into a general-purpose.
1 Types of Programming Language (1) Three types of programming languages 1.Machine languages Strings of numbers giving machine specific instructions Example:
INTRODUCTION TO COMPUTER PROGRAMMING(IT-303) Basics.
L071 Introduction to C Topics Compilation Using the gcc Compiler The Anatomy of a C Program Reading Sections
Java Programming Fifth Edition Chapter 1 Creating Your First Java Classes.
From Algorithms to Programs Both are sets of instructions on how to do a task Algorithm: –talking to humans, easy to understand –in plain (English) language.
Introduction to C Topics Compilation Using the gcc Compiler
Chapter 1 Introduction 2nd Semester H
UMBC CMSC 104 – Section 01, Fall 2016
Unit 3: ALGORITHMS AND FLOWCHARTS
CSCI-235 Micro-Computer Applications
C Programming Hardik H. Maheta.
Algorithms Problem: Write pseudocode for a program that keeps asking the user to input integers until the user enters zero, and then determines and outputs.
History of ‘C’ Root of the morden language is ALGOL It’s first
Overview of C.
Introduction to C Topics Compilation Using the gcc Compiler
C language IT-1 (Batch-A) Name: EnNo: Arshad Muthalif
Introduction to C Topics Compilation Using the gcc Compiler
Introduction to C Programming Language
' C ' PROGRAMMING SRM-MCA.
Welcome In The World Of ‘C’.  TEXT BOOK: Programming in ANSI ‘C By: E Balagurusamy. TMH  Reference Books: 1) The ‘C Programming Language By: Kernighan.
The C Programming Language
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
Introduction C is a general-purpose, high-level language that was originally developed by Dennis M. Ritchie to develop the UNIX operating system at Bell.
Programming Fundamentals Lecture #3 Overview of Computer Programming
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
C programming Language
Introduction to Computer Programming
An Overview of C.
Introduction to C Topics Compilation Using the gcc Compiler
Presentation transcript:

Welcome In The World Of ‘C’

 TEXT BOOK: Programming in ANCI ‘C By: E Balagurusamy. TMH  Reference Books: 1) The ‘C Programming Language By: Kernighan and Ritchie. PHI Second Edition. 2) Let Us ‘C By: Yashwant Kanitkar

Teaching Scheme  During a week 3 Lectures + 1 Tutorial 1 Practical/Laboratory of two hour.  Marks system: Theory External Exam60 Practical Exam / Viva 50 Internal (Avg. of 3 exams)36 Attendance 4 Total 150

Importance of Subject  ‘C is the base language of any other programming language.  To be a Good Programmer one must know fundamentals of C programming language.

History of ‘C’  Root of the morden language is ALGOL It’s first computer language to use a block structure. It gave concept of structured programming.  In 1967, Martin Richards developed a language, BCPL (Basic Combined Programming Language)

 In 1970,by Ken Thompson created a language called as ‘B’. It used to create early version of Unix.  In 1972,by Dennis Ritchie introduced new language called as ‘C’.

1972 Traditional C Dennis Ritchie 1990 ANSI/ISO C ISO Committee 1978 K&R C Kernighan &Ritchie 1989 ANSI C ANSI Committee

 It is a robust language.  Programs written in ‘C’ are efficient and fast. (Because of variety of data types and powerful operators)  Highly Portable. (related to OS)  Well suited for structured programming.  Ability to extend itself. Features Of ‘C’

Program & Programming Language Program:- A Set of instructions which When carried out by processor for some Specific input, generates specific output. Programming language:- A specific manner of writing a program with some Predefined rules, symbols & their use as a part of language. i.e. Pascal, C, C++, VC++, JAVA, VB.

Basic structure of ‘C’ 1)Documentation Section :- It has set of comment lines(name of program, author details). What is Comment line??  To guide a programmer. To write a note for function,operation,logic in between a program.  Non-executable statement.  Can’t be nested. e.g:- /* Hello /* abc */ Hi */ ERROR.

2)Link Section :- It provides instructions to the compiler to link function from the system library. # include Directive:-  To access the functions which are stored in the library, it is necessary to tell the compiler, about the file to be accessed. Syntax:- #include  stdio.h is header file.

It defines all symbolic constants. #define instuction defines value to a symbolic constant. #define:-  It is a preprocessor compiler directive, not a statement.  Therefore it should not end with a semicolon.  Generally written in uppercase.

Some variables that are used in more than on function, such variables (global variables) declared in the global declaration section. It also declares all the user-defined function.

Every ‘C’ program must have one main() function section. It contains two parts 1) Declaration part: It declares all variables used in the executable part. 2) Executable part: It has atleast one statement.

main( ) = main (void) No arguments Explicitly indicate no arguments

Documentation section Link Section Definition Section Global Declaration Section main() function section { Declaration part Executable part } Subprogram section Function1 Function2 … user defined function

 There are two ways to run programs written in a high- level language.run  The most common is to compile the programcompile  The other method is to pass the program through an interpreter.

Compiler Why compiler is require ? As machine (a processor) can operate On binary code instruction only….. If we use higher level language then … For execution of the program we must Convert it to lower level / machine level Code.

Means, A program that translates source code into object code.programsource code object code The compiler derives its name from the way it works, looking at the entire piece of source code and collecting and reorganizing the instructions. instructions Interpreter: which analyzes and executes each line of source code without looking at the entire program.executes

Advantage of interpreter: It can execute a program immediately. Compilers require some time before an executable program emerges. But, However, programs produced by compilers run much faster than the same programs executed by an interpreter.run

C Compiler - checks for syntax errors if any - on success coverts ‘C source code into object code form – which is nearer to machine…

Linker: A linker is a program that combines object modules to form an executable program.program modules

Types of languages (I) Lower level languages:- Languages which are very near to machine…. I.e. machine language, Assembly language. (II) Higher level languages:- Languages which are very near to programmer rather than to machine…. I.e. C++,Visual C++,Visual basic,Java.

Block Diagram: Represents only -> what should be the input? -> what will be the output? - One need not to worry about how the result generated…. - or what will be the logic for the program?

Input No1. & No2. PROGRAM No1 + No2 Output Block Diagram for making addition of two numbers :

Algorithm Specifies steps of doing the things Irrespective of any programminglanguage Example: Addition of two numbers Step 1: [Read two numbers] Read(no1) Read(no2) Step 2:[add two numbers into sum] summation = no1 + no2 Step 3:[Display the result] write (summation)

Flowchart Represents the flow of program Symbols:- Start-Begin/End Input/Output Rectangle Process box/operation box Decision Box Connector

Flowchart-example Example: To add two numbers and display the result. Start SUMMATION = NO1 + NO2 End Read No1 and No2 from user Write Summation on monitor

Files:- storage of logically relateddata Directory:- Placeholder which can store files and subdirectories within them. File Extension:- special postfix attached to each file which indicates type of the file.

/* print hello*/ #include /* link section*/ void main() /* execution of program*/ { print(“hello world”); /*executable statement*/ }

I.e. “hello.c”, here “hello” is filename and “c” is file extension which indicates that hello is a ‘c program.