SlideShare a Scribd company logo
CSE-1121 (Structured Programming Language)
        Department of Computer Science and Engineering
                     DUET, Gazipur-1700

              •   Md. Shohidul Islam
                  Lecturer, Department of CSE

              •   Md. Mahbub Alam
                  Lecture, Department of CSE



                  June, 2010(EVEN SEMESTER)


Md. Mahbub Alam       Structured Programming Language    1
                                 (CSE-1121)
Text Books and Other Class Room Material

      Text Books
          1.      Programming in ANSI C (3rd Edition) by E Balagurusamy
          2.      C – The Complete Reference (4th Edition) by Herbert Schildt
          3.      C – How To Program (4th Edition) by Deitel & Deitel

      Useful Links
          •       http://www.lysator.liu.se/c/bwk-tutor.html
          •       http://www.cs.cf.ac.uk/Dave/C




Md. Mahbub Alam               Structured Programming Language                   2
                                         (CSE-1121)
Course Outline
         Introduction to C programming
         Constants, variable & data types
         C Operators & expressions
         Managing I/O operations in C
         C Control structure
         C Arrays
         C Characters and Strings
         C Functions
         C Pointers
         Structure and Union in C
         Dynamic Memory Allocation in C
         File processing in C
         Graphics programming in C
         Built in functions in C




 Md. Mahbub Alam         Structured Programming Language   3
                                    (CSE-1121)
Class Hour
         Theory: 2 lecture per week (Sunday & Tuesday 08:50 AM – 09:40 AM )
         Room No - 314
         Lab: Tuesday 11:00 AM – 01:30 PM & 02:30 PM – 05:00 PM
         Room No – Software Lab

How Contact With Me
        Room No : 332
        Mobile : +8801672917778
        Email : emahbub.cse@gmail.com




Md. Mahbub Alam            Structured Programming Language                    4
                                      (CSE-1121)
Marks Distribution
                                                 Total Mark      300
        Class Attendance                                        10%
        Class Test/Quiz Test/Assignment                         20%
        Final Exam                                              70%
                                                      Total 100%

Grading System
          Numerical Grade           Letter Grade         Grade point
         80% or above           A+ (A Plus)                   4.00
         75% to less than 80%   A (A Regular )                3.75
         70% to less than 75%   A- (A Minus)                  3.50
         65% to less than 70%   B+ (B Plus)                   3.25
         60% to less than 65%   B (B Regular)                 3.00
         55% to less than 60%   B- (B Minus)                  2.75
         50% to less than 55%   C+ (C Plus)                   2.50
         45% to less than 50%   C (C Regular)                 2.25
         40% to less than 45%   D                             2.00
         Less than 40%          F                             0.00


Md. Mahbub Alam                  Structured Programming Language       5
                                            (CSE-1121)
Lecture01 (Introduction to C programming )
June 13, 2010
      Today's Outline
         History of C
         Importance of C
         Basic Structure of C program
         “Hello world program”
         C program development environment




 Md. Mahbub Alam    Structured Programming Language   6
                               (CSE-1121)
History of C
C evolved from two previous programming languages, BCPL and B
by “Dennis Ritchie” at Bell Laboratories on DEC PDP-11 machine
in 1972.
 - In 1967, BCPL (Basic Combined Programming Language) was developed by
   Martin Richards as a language for writing operating system software &
   compilers.
 - In 1970, Ken Thompson developed B using many features of BCPL and early
   versions of UNIX operating system at Bell Laboratories on DEC PDP-7
   machine.
Initially, C widely known as the development language of the UNIX
operating system but today virtually all new major operating systems
are written in C and/or C++.
By the late 1970's, C had evolved into what is now referred as
"Traditional C“.
 Md. Mahbub Alam       Structured Programming Language             7
                                  (CSE-1121)
History of C (Cont.)
Rapid expansion of C over various types of computers led to many
variations of the language that were similar but often incompatible
which was serious problem for program developers who needed to
develop platform independent code.
A technical committee (X3J11) was created under ANSI to define a
standard version of C. In 1989, the committee approved a standard
version of which was known as ANSI C (C89).
In 1990, this standard was approved by ISO referred to as
ANSI/ISO Standard C which was updated in 1999 referred to as
C99.




Md. Mahbub Alam     Structured Programming Language          8
                               (CSE-1121)
Why teach C?
• C is small (only 32 keywords).
• C has rich set of built-in functions and support variety of data
  types & operators.
• C is highly portable (Machine independent).
• C is structured.
• C has ability to extend itself.
• C is stable (the language doesn’t change much).
• C is quick running (code written in c is efficient & fast).
• C is the basis for many other languages (Java, C++, Perl etc).
• C is a Programmers Language.

  It may not feel like it but C is one of the easiest language to
  learn.

  Md. Mahbub Alam      Structured Programming Language              9
                                  (CSE-1121)
Basic Structure of C Program
Documentation Section               Set of comments lines( prg. name, author & other info)
Link Section                        Link the program with functions of system library
Definition Section                  Defines all symbolic constants
Global Declaration Section          Declares global variables & user-defined functions
main() Function Section
                                    Every program must have main() function. Program
{                                   execution begins at opening braces & ends at closing
}                                   braces of main() function.
Subprogram Section
function1()
{                                   Definition of all user-defined functions
}
::::::::::
functionN()
{
}

   Md. Mahbub Alam           Structured Programming Language                             10
                                        (CSE-1121)
Hello World Program

                                             Comments

/* My first C program which prints Hello World */

#include <stdio.h>
                                                   Main() function begin here
int main ()
{                                          Library function
    printf("Hello World!n");
    return 0;
}                      Return 0 from main means our program
                                  finished without errors



                                       Main() function ends here


  Md. Mahbub Alam      Structured Programming Language                      11
                                  (CSE-1121)
Typical C program
                                            development environment




Md. Mahbub Alam   Structured Programming Language                 12
                             (CSE-1121)
Any Question?




Md. Mahbub Alam   Structured Programming Language   13
                             (CSE-1121)
Thank You All




Md. Mahbub Alam     Structured Programming Language   14
                               (CSE-1121)

More Related Content

PPT
Why C is Called Structured Programming Language
Sinbad Konick
 
PPT
Introduction to programming with c,
Hossain Md Shakhawat
 
PPTX
introduction to c language
Rai University
 
PDF
Learning the C Language
nTier Custom Solutions
 
PPTX
An Overview of Programming C
Nishargo Nigar
 
PDF
SULTHAN's - C Programming Language notes
SULTHAN BASHA
 
PPTX
Introduction to c programming
Manoj Tyagi
 
PPSX
Introduction of c language
Akhilesh Maithani
 
Why C is Called Structured Programming Language
Sinbad Konick
 
Introduction to programming with c,
Hossain Md Shakhawat
 
introduction to c language
Rai University
 
Learning the C Language
nTier Custom Solutions
 
An Overview of Programming C
Nishargo Nigar
 
SULTHAN's - C Programming Language notes
SULTHAN BASHA
 
Introduction to c programming
Manoj Tyagi
 
Introduction of c language
Akhilesh Maithani
 

What's hot (20)

PPTX
Introduction to C Language (By: Shujaat Abbas)
Shujaat Abbas
 
PPTX
Std 10 computer chapter 10 introduction to c language (part1)
Nuzhat Memon
 
PDF
C programming part1
Gaddam Kowshik
 
PPT
C PROGRAMMING
Stalongiles Philip
 
PDF
SysProg-Tutor 01 Introduction to C Programming Language
Wongyos Keardsri
 
PDF
Abc c program
Dayakar Siddula
 
PPTX
Introduction to C Language
Kamal Acharya
 
PPTX
Introduction to c programming
Alpana Gupta
 
PPTX
C Programming Language
Gitanshu Gitanshu
 
PPTX
Introduction of c programming
Tarun Sharma
 
PDF
Principles of-programming-languages-lecture-notes-
Krishna Sai
 
PPT
Introduction to programming languages part 1
university of education,Lahore
 
PPT
Programming language
Dhani Ahmad
 
PPT
Introduction to Procedural Programming in C++
Salahaddin University-Erbil
 
PPT
01 c
aynsvicky
 
PPT
introduction to C programming (C)
Abhishek Walia
 
PPT
PROGRAMMING LANGUAGES
ABHINAV SINGH
 
PPTX
C languaGE UNIT-1
Malikireddy Bramhananda Reddy
 
PDF
Programing paradigm &amp; implementation
Bilal Maqbool ツ
 
PDF
C Language
Syed Zaid Irshad
 
Introduction to C Language (By: Shujaat Abbas)
Shujaat Abbas
 
Std 10 computer chapter 10 introduction to c language (part1)
Nuzhat Memon
 
C programming part1
Gaddam Kowshik
 
C PROGRAMMING
Stalongiles Philip
 
SysProg-Tutor 01 Introduction to C Programming Language
Wongyos Keardsri
 
Abc c program
Dayakar Siddula
 
Introduction to C Language
Kamal Acharya
 
Introduction to c programming
Alpana Gupta
 
C Programming Language
Gitanshu Gitanshu
 
Introduction of c programming
Tarun Sharma
 
Principles of-programming-languages-lecture-notes-
Krishna Sai
 
Introduction to programming languages part 1
university of education,Lahore
 
Programming language
Dhani Ahmad
 
Introduction to Procedural Programming in C++
Salahaddin University-Erbil
 
01 c
aynsvicky
 
introduction to C programming (C)
Abhishek Walia
 
PROGRAMMING LANGUAGES
ABHINAV SINGH
 
Programing paradigm &amp; implementation
Bilal Maqbool ツ
 
C Language
Syed Zaid Irshad
 
Ad

Viewers also liked (9)

PPTX
Introduction to c programming
gautam buddha university
 
PPT
C programming
Anurag Byala
 
PPTX
C introduction by thooyavan
Thooyavan Venkatachalam
 
PDF
Gtk development-using-glade-3
caezsar
 
PPTX
Introduction to c programming
Sivant Kolhe
 
PDF
Introduction to the c programming language (amazing and easy book for beginners)
mujeeb memon
 
PPT
Brief introduction to the c programming language
Kumar Gaurav
 
PPSX
INTRODUCTION TO C PROGRAMMING
Abhishek Dwivedi
 
PPTX
Introduction to C Programming
Amr Ali (ISTQB CTAL Full, CSM, ITIL Foundation)
 
Introduction to c programming
gautam buddha university
 
C programming
Anurag Byala
 
C introduction by thooyavan
Thooyavan Venkatachalam
 
Gtk development-using-glade-3
caezsar
 
Introduction to c programming
Sivant Kolhe
 
Introduction to the c programming language (amazing and easy book for beginners)
mujeeb memon
 
Brief introduction to the c programming language
Kumar Gaurav
 
INTRODUCTION TO C PROGRAMMING
Abhishek Dwivedi
 
Ad

Similar to Lecture01 (introduction to c programming) (20)

PPTX
Lecture01-Introduction-to-C-programming-converted (4).pptx
MdMuaz2
 
PPT
Intro1
phanleson
 
PPTX
Comparison between C and C++
muhammadmohsin255776
 
PPTX
Expection Setting - 1st ppt. pptx
DarshanR953832
 
PPTX
Programming.pptx
JharnaSahane
 
PPT
C programming presentation for university
Sheikh Monirul Hasan
 
PPT
Intro. to prog. c++
KurdGul
 
DOCX
Programming In C- (1)jhgjhgjhgjhghj.docx
Dpak Chavan
 
PPTX
UNIT - 1jhjhjbkjhkjhkjhkjhkjhhkkhhh.pptx
RoselinLourd
 
PPT
c++ programming language Lecture 1-3.ppt
ssuser8ac8e7
 
PPTX
Introduction to C Programming
Anandhasilambarasan D
 
PPT
Chapter 1 - Overview of C
Munazza-Mah-Jabeen
 
PPTX
Chapter 1 Introduction to C .pptx
Abdalla536859
 
PPTX
C vs c++
Gaurav Badhan
 
PDF
Module 201 2 20 just 20 basic
Nick Racers
 
PDF
Module 1 2 just basic-
Shanmugam Thiagoo
 
PPTX
C programming presentation(final)
aaravSingh41
 
DOCX
C Unit 1 notes PREPARED BY MVB REDDY
Rajeshkumar Reddy
 
PDF
Solution Manual for C++ How to Program: Late Objects Version, 7/E 7th Edition...
rawayshirox2
 
Lecture01-Introduction-to-C-programming-converted (4).pptx
MdMuaz2
 
Intro1
phanleson
 
Comparison between C and C++
muhammadmohsin255776
 
Expection Setting - 1st ppt. pptx
DarshanR953832
 
Programming.pptx
JharnaSahane
 
C programming presentation for university
Sheikh Monirul Hasan
 
Intro. to prog. c++
KurdGul
 
Programming In C- (1)jhgjhgjhgjhghj.docx
Dpak Chavan
 
UNIT - 1jhjhjbkjhkjhkjhkjhkjhhkkhhh.pptx
RoselinLourd
 
c++ programming language Lecture 1-3.ppt
ssuser8ac8e7
 
Introduction to C Programming
Anandhasilambarasan D
 
Chapter 1 - Overview of C
Munazza-Mah-Jabeen
 
Chapter 1 Introduction to C .pptx
Abdalla536859
 
C vs c++
Gaurav Badhan
 
Module 201 2 20 just 20 basic
Nick Racers
 
Module 1 2 just basic-
Shanmugam Thiagoo
 
C programming presentation(final)
aaravSingh41
 
C Unit 1 notes PREPARED BY MVB REDDY
Rajeshkumar Reddy
 
Solution Manual for C++ How to Program: Late Objects Version, 7/E 7th Edition...
rawayshirox2
 

Recently uploaded (20)

PDF
The Minister of Tourism, Culture and Creative Arts, Abla Dzifa Gomashie has e...
nservice241
 
PPTX
Cleaning Validation Ppt Pharmaceutical validation
Ms. Ashatai Patil
 
PPTX
Basics and rules of probability with real-life uses
ravatkaran694
 
PPTX
Kanban Cards _ Mass Action in Odoo 18.2 - Odoo Slides
Celine George
 
PPTX
Care of patients with elImination deviation.pptx
AneetaSharma15
 
PPTX
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
PPTX
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
DOCX
Action Plan_ARAL PROGRAM_ STAND ALONE SHS.docx
Levenmartlacuna1
 
PDF
Virat Kohli- the Pride of Indian cricket
kushpar147
 
PPTX
How to Close Subscription in Odoo 18 - Odoo Slides
Celine George
 
DOCX
SAROCES Action-Plan FOR ARAL PROGRAM IN DEPED
Levenmartlacuna1
 
PPTX
CARE OF UNCONSCIOUS PATIENTS .pptx
AneetaSharma15
 
PDF
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
PPTX
INTESTINALPARASITES OR WORM INFESTATIONS.pptx
PRADEEP ABOTHU
 
PPTX
How to Track Skills & Contracts Using Odoo 18 Employee
Celine George
 
PDF
Biological Classification Class 11th NCERT CBSE NEET.pdf
NehaRohtagi1
 
PPTX
Python-Application-in-Drug-Design by R D Jawarkar.pptx
Rahul Jawarkar
 
PPTX
Information Texts_Infographic on Forgetting Curve.pptx
Tata Sevilla
 
PDF
The-Invisible-Living-World-Beyond-Our-Naked-Eye chapter 2.pdf/8th science cur...
Sandeep Swamy
 
DOCX
pgdei-UNIT -V Neurological Disorders & developmental disabilities
JELLA VISHNU DURGA PRASAD
 
The Minister of Tourism, Culture and Creative Arts, Abla Dzifa Gomashie has e...
nservice241
 
Cleaning Validation Ppt Pharmaceutical validation
Ms. Ashatai Patil
 
Basics and rules of probability with real-life uses
ravatkaran694
 
Kanban Cards _ Mass Action in Odoo 18.2 - Odoo Slides
Celine George
 
Care of patients with elImination deviation.pptx
AneetaSharma15
 
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
Action Plan_ARAL PROGRAM_ STAND ALONE SHS.docx
Levenmartlacuna1
 
Virat Kohli- the Pride of Indian cricket
kushpar147
 
How to Close Subscription in Odoo 18 - Odoo Slides
Celine George
 
SAROCES Action-Plan FOR ARAL PROGRAM IN DEPED
Levenmartlacuna1
 
CARE OF UNCONSCIOUS PATIENTS .pptx
AneetaSharma15
 
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
INTESTINALPARASITES OR WORM INFESTATIONS.pptx
PRADEEP ABOTHU
 
How to Track Skills & Contracts Using Odoo 18 Employee
Celine George
 
Biological Classification Class 11th NCERT CBSE NEET.pdf
NehaRohtagi1
 
Python-Application-in-Drug-Design by R D Jawarkar.pptx
Rahul Jawarkar
 
Information Texts_Infographic on Forgetting Curve.pptx
Tata Sevilla
 
The-Invisible-Living-World-Beyond-Our-Naked-Eye chapter 2.pdf/8th science cur...
Sandeep Swamy
 
pgdei-UNIT -V Neurological Disorders & developmental disabilities
JELLA VISHNU DURGA PRASAD
 

Lecture01 (introduction to c programming)

  • 1. CSE-1121 (Structured Programming Language) Department of Computer Science and Engineering DUET, Gazipur-1700 • Md. Shohidul Islam Lecturer, Department of CSE • Md. Mahbub Alam Lecture, Department of CSE June, 2010(EVEN SEMESTER) Md. Mahbub Alam Structured Programming Language 1 (CSE-1121)
  • 2. Text Books and Other Class Room Material Text Books 1. Programming in ANSI C (3rd Edition) by E Balagurusamy 2. C – The Complete Reference (4th Edition) by Herbert Schildt 3. C – How To Program (4th Edition) by Deitel & Deitel Useful Links • http://www.lysator.liu.se/c/bwk-tutor.html • http://www.cs.cf.ac.uk/Dave/C Md. Mahbub Alam Structured Programming Language 2 (CSE-1121)
  • 3. Course Outline Introduction to C programming Constants, variable & data types C Operators & expressions Managing I/O operations in C C Control structure C Arrays C Characters and Strings C Functions C Pointers Structure and Union in C Dynamic Memory Allocation in C File processing in C Graphics programming in C Built in functions in C Md. Mahbub Alam Structured Programming Language 3 (CSE-1121)
  • 4. Class Hour Theory: 2 lecture per week (Sunday & Tuesday 08:50 AM – 09:40 AM ) Room No - 314 Lab: Tuesday 11:00 AM – 01:30 PM & 02:30 PM – 05:00 PM Room No – Software Lab How Contact With Me Room No : 332 Mobile : +8801672917778 Email : [email protected] Md. Mahbub Alam Structured Programming Language 4 (CSE-1121)
  • 5. Marks Distribution Total Mark 300 Class Attendance 10% Class Test/Quiz Test/Assignment 20% Final Exam 70% Total 100% Grading System Numerical Grade Letter Grade Grade point 80% or above A+ (A Plus) 4.00 75% to less than 80% A (A Regular ) 3.75 70% to less than 75% A- (A Minus) 3.50 65% to less than 70% B+ (B Plus) 3.25 60% to less than 65% B (B Regular) 3.00 55% to less than 60% B- (B Minus) 2.75 50% to less than 55% C+ (C Plus) 2.50 45% to less than 50% C (C Regular) 2.25 40% to less than 45% D 2.00 Less than 40% F 0.00 Md. Mahbub Alam Structured Programming Language 5 (CSE-1121)
  • 6. Lecture01 (Introduction to C programming ) June 13, 2010 Today's Outline History of C Importance of C Basic Structure of C program “Hello world program” C program development environment Md. Mahbub Alam Structured Programming Language 6 (CSE-1121)
  • 7. History of C C evolved from two previous programming languages, BCPL and B by “Dennis Ritchie” at Bell Laboratories on DEC PDP-11 machine in 1972. - In 1967, BCPL (Basic Combined Programming Language) was developed by Martin Richards as a language for writing operating system software & compilers. - In 1970, Ken Thompson developed B using many features of BCPL and early versions of UNIX operating system at Bell Laboratories on DEC PDP-7 machine. Initially, C widely known as the development language of the UNIX operating system but today virtually all new major operating systems are written in C and/or C++. By the late 1970's, C had evolved into what is now referred as "Traditional C“. Md. Mahbub Alam Structured Programming Language 7 (CSE-1121)
  • 8. History of C (Cont.) Rapid expansion of C over various types of computers led to many variations of the language that were similar but often incompatible which was serious problem for program developers who needed to develop platform independent code. A technical committee (X3J11) was created under ANSI to define a standard version of C. In 1989, the committee approved a standard version of which was known as ANSI C (C89). In 1990, this standard was approved by ISO referred to as ANSI/ISO Standard C which was updated in 1999 referred to as C99. Md. Mahbub Alam Structured Programming Language 8 (CSE-1121)
  • 9. Why teach C? • C is small (only 32 keywords). • C has rich set of built-in functions and support variety of data types & operators. • C is highly portable (Machine independent). • C is structured. • C has ability to extend itself. • C is stable (the language doesn’t change much). • C is quick running (code written in c is efficient & fast). • C is the basis for many other languages (Java, C++, Perl etc). • C is a Programmers Language. It may not feel like it but C is one of the easiest language to learn. Md. Mahbub Alam Structured Programming Language 9 (CSE-1121)
  • 10. Basic Structure of C Program Documentation Section Set of comments lines( prg. name, author & other info) Link Section Link the program with functions of system library Definition Section Defines all symbolic constants Global Declaration Section Declares global variables & user-defined functions main() Function Section Every program must have main() function. Program { execution begins at opening braces & ends at closing } braces of main() function. Subprogram Section function1() { Definition of all user-defined functions } :::::::::: functionN() { } Md. Mahbub Alam Structured Programming Language 10 (CSE-1121)
  • 11. Hello World Program Comments /* My first C program which prints Hello World */ #include <stdio.h> Main() function begin here int main () { Library function printf("Hello World!n"); return 0; } Return 0 from main means our program finished without errors Main() function ends here Md. Mahbub Alam Structured Programming Language 11 (CSE-1121)
  • 12. Typical C program development environment Md. Mahbub Alam Structured Programming Language 12 (CSE-1121)
  • 13. Any Question? Md. Mahbub Alam Structured Programming Language 13 (CSE-1121)
  • 14. Thank You All Md. Mahbub Alam Structured Programming Language 14 (CSE-1121)