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.

Slides:



Advertisements
Similar presentations
C Language.
Advertisements

C++ Basics Variables, Identifiers, Assignments, Input/Output.
Chapter 3: Beginning Problem Solving Concepts for the Computer Programming Computer Programming Skills /1436 Department of Computer Science.
Introduction to Computing Lecture 01: Introduction to C Introduction to Computing Lecture 01: Introduction to C Assist.Prof.Dr. Nükhet ÖZBEK Ege University.
Structure of a C program
C Programming Basics Lecture 5 Engineering H192 Winter 2005 Lecture 05
1 Key Concepts:  Why C?  Life Cycle Of a C program,  What is a computer program?  A program statement?  Basic parts of a C program,  Printf() function?
CS1061 C Programming Lecture 4: Indentifiers and Integers A.O’Riordan, 2004.
Program A computer program (also software, or just a program) is a sequence of instructions written in a sequence to perform a specified task with a computer.
C Tokens Identifiers Keywords Constants Operators Special symbols.
C-Language Keywords(C99)
Introduction to Programming David Goldschmidt, Ph.D. Computer Science The College of Saint Rose Java Fundamentals (Comments, Variables, etc.)
Program A computer program (also software, or just a program) is a sequence of instructions written in a sequence to perform a specified task with a computer.
JAVA Tokens. Introduction A token is an individual element in a program. More than one token can appear in a single line separated by white spaces.
Lecture #5 Introduction to C++
C Programming Laboratory I. Introduction to C Language /* the first program for user */ #include int a=0; int main(void) { printf(“Hello World\n”); return.
C Programming language Basic Concepts Prepared By The Smartpath Information systems
Dennis Ritchie 1972 AT & T Bell laboratories (American Telephone and Telegraph) USA 1www.gowreeswar.com.
Engineering H192 - Computer Programming Gateway Engineering Education Coalition Lect 5P. 1Winter Quarter C Programming Basics Lecture 5.
Data Structure and c K.S.Prabhu Lecturer All Deaf Educational Technology.
By Anand George SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)
BASIC C PROGRAMMING LANGUAGE TUTORIAL infobizzs.com.
Introduction to C Programming I Subject: T0016 – ALGORITHM AND PROGRAMMING Year: 2013.
Numbers in ‘C’ Two general categories: Integers Floats
C++ Lesson 1.
Variables, Identifiers, Assignments, Input/Output
Basics (Variables, Assignments, I/O)
Data types Data types Basic types
BASIC ELEMENTS OF A COMPUTER PROGRAM
LESSON 3 IO, Variables and Operators
C Language VIVA Questions with Answers
Learning C Language.
C Fundamentals & Pointers
BY GAWARE S.R. COMPUTER SCI. DEPARTMENT
C Short Overview Lembit Jürimägi.
C Basics.
Prepared By: G.UshaRani B.Pranalini A.S.Lalitha
Introduction to C Programming Language
' C ' PROGRAMMING SRM-MCA.
Introduction to C Programming
CSE101-Lec#3 Components of C Identifiers and Keywords Data types.
INTRODUCTION c is a general purpose language which is very closely associated with UNIX for which it was developed in Bell Laboratories. Most of the programs.
Visit for more Learning Resources
11/10/2018.
Basics (Variables, Assignments, I/O)
Character Set The character set of C represents alphabet, digit or any symbol used to represent information. Types Character Set Uppercase Alphabets A,
פרטים נוספים בסילבוס של הקורס
An Introduction to Java – Part I, language basics
Variables in C Topics Naming Variables Declaring Variables
Basics of ‘C’.
פרטים נוספים בסילבוס של הקורס
Govt. Polytechnic,Dhangar
Variables, Identifiers, Assignments, Input/Output
Govt. Polytechnic,Dhangar
Variables in C Declaring , Naming, and Using Variables.
Chap 1 Chap 2 Chap 3 Chap 5 Surprise Me
C programming Language
WEEK-2.
Programming Language C Language.
The C Language: Intro.
C – Programming Language
Building Blocks of C Programming Language
Variables in C Topics Naming Variables Declaring Variables
C Language B. DHIVYA 17PCA140 II MCA.
Variables in C Topics Naming Variables Declaring Variables
Course Outcomes of Programming In C (PIC) (17212, C203):
Variables in C Topics Naming Variables Declaring Variables
INTRODUCTION TO C.
Variables in C Topics Naming Variables Declaring Variables
Getting Started With Coding
Presentation transcript:

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 Labs. In 1972, Dennis Ritchie at Bell Laboratories wrote C Language which caused a revolution in computing world. Most of the programs of UNIX are written and run with the help of 'C'.

Introduction 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 Name 'C' was given to this language? Many of the ideas of C language were derived and taken from 'B' language. BCPL ("Basic Combined Programming Language") is previous version of 'B' language. As many features came from B it was named as 'C'.

Structure Of “C ” Programs Before going and reading the structure of C programs we need to have a basic knowledge of the following: C's Character Set C's Keywords The General Structure of a 'C' Program How To End A Statement Free Format Language Header Files & Library Functions

C's Character Set C does not use every character set and key found on modern computers . The only characters that C - Language uses for its programs are as follows: A-Z all alphabets a-z all alphabets  0-9  # % & ! _ {} [] () $$$$ &&&& |  space . , : ; ' $ "  + - / * =

The keywords "Keywords" are words that have special meaning to the C compiler. Their meaning cannot be changed at any instance. Serve as basic building blocks for program statements. All keywords are written in only lowercase.

Basic Structure Of “C ” Programs #include<stdio.h> #include<conio.h> void main() { -- other statements } Header Files Entry Point Of Program Indicates Starting of Program

Header files The files that are specified in the include section is called as Header File. These are precompiled files that has some functions defined in them. We can call those functions in our program by supplying parameters. Header file is given an extension ".h". C Source file is given an extension ".c" .

Main function Main is the “Entry Point” of a program. When a file is executed, the start point is the main function. From main function the flow goes as per the programmers choice. Main function is compulsory for any C program.

Run ning a ‘C ’ Program Type a program. Save it. Compile the program – This will generate an .exe file (executable) Run the program (Actually the exe created out of compilation will run and not the .c file) In different compiler we have different option for compiling and running.

“C ” language TOKENS The smallest individual units in a C program are known as tokens. In a C source program, the basic element recognized by the compiler is the "token." A token is source-program text that the compiler does not break down into component elements. C has 6 different types of tokens- Keywords [e.g. float, int, while] Identifiers [e.g. main, amount] Constants [e.g. -25.6, 100] Strings [e.g. “SMIT”, “year”] Special Symbols [e.g. {, }, [, ] ] Operators [e.g. +, -, *] Strin gs C programs are written using these tokens and the general syntax.

Keywords in Ansi “C ” auto break case char const continue default do There are 32 keywords in C Programming Language:- auto break case char const continue default do double else enum etern float for goto if register return short signed sizeof static struct int switch typedef union unsigned void volatile while long

Data types in ‘ansi c’ There are three classes of data types here:: Primitive data types int, float, double, char Aggregate OR derived data types Arrays come under this category Arrays can contain collection of int or float or char or double data User defined data types Structures and enum fall under this category.

Example of “C ” Program /* HELLO.C -- Hello, world */ Output #include <stdio.h> Void main() { printf("Hello, world\n"); Getch(); }

C- Operators Arithmetic Operators (e.g: +, -, *, %, ++, --) C language provides the following types of operators − Arithmetic Operators (e.g: +, -, *, %, ++, --) Relational Operators (e.g: ==, !=, <, >, <=, >=) Logical Operators (e.g: &&, ||, !) Bitwise Operators (e.g: &, |, <<, >>) Assignment Operators (e.g: =, +=, -=, *=, etc.)

C- Constructs C language provides three types of constructs− Sequential Decision Making Repetitive

C- Arrays Arrays a kind of data structure that can store a fixed-size sequential collection of elements of the same type.  e.g: following diagram represents that we are storing five numbers of integer type.

C- Structures  Similarly structure is another user defined data type available in C that allows to combine data items of different kinds.

C- Files A file represents a sequence of bytes, regardless of it being a text file or a binary file.