Chapter 1 Introduction to C Programming

Slides:



Advertisements
Similar presentations
CSE 105 Structured Programming Language (C)
Advertisements

Overview of programming in C C is a fast, efficient, flexible programming language Paradigm: C is procedural (like Fortran, Pascal), not object oriented.
ARDUINO CLUB Session 1: C & An Introduction to Linux.
Chapter Three Arithmetic Expressions and Assignment Statements
1 C++ Syntax and Semantics The Development Process.
Software Development Method. Assignments Due – Homework 0, Warmup Reading – Chapter 2 –
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Fundamentals of Strings and Characters Characters.
1 Lecture 2  Input-Process-Output  The Hello-world program  A Feet-to-inches program  Variables, expressions, assignments & initialization  printf()
Three types of computer languages
1 9/8/08CS150 Introduction to Computer Science 1 Data Types Section 2.7 – 2.12 CS 150 Introduction to Computer Science I.
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?
Introduction to C Programming Overview of C Hello World program Unix environment C programming basics.
1 Key Concepts:  Data types in C.  What is a variable?  Variable Declaration  Variable Initialization  Printf()  Scanf()  Working with numbers in.
 2000 Prentice Hall, Inc. All rights reserved. Chapter 8 - Characters and Strings Outline 8.1Introduction 8.2Fundamentals of Strings and Characters 8.3Character.
Moving To Code 3 More on the Problem-Solving Process §The final step in the problem-solving process is to evaluate and modify (if necessary) the program.
 2000 Prentice Hall, Inc. All rights reserved. 1 Introduction to Computers and C Programming Outline Introduction What Is a Computer? Computer Organization.
Introduction to C Language
Variables and Data Types
C Tokens Identifiers Keywords Constants Operators Special symbols.
1 CSC103: Introduction to Computer and Programming Lecture No 6.
King Saud University College of applied studies and community services CSC 1101 Computer Programming I Lecture 2.
Constants Numeric Constants Integer Constants Floating Point Constants Character Constants Expressions Arithmetic Operators Assignment Operators Relational.
Course Title: Object Oriented Programming with C++ instructor ADEEL ANJUM Chapter No: 03 Conditional statement 1 BY ADEEL ANJUM (MSc-cs, CCNA,WEB DEVELOPER)
CSCI 130 Chapter 3. Variables & Names Variable Declarations: –reserve a storage location in memory –identify the name of the variable –identify the type.
THE BASICS OF A C++ PROGRAM EDP 4 / MATH 23 TTH 5:45 – 7:15.
Chapter 05 (Part III) Control Statements: Part II.
VARIABLES, CONSTANTS, OPERATORS ANS EXPRESSION
CSCI 3133 Programming with C Instructor: Bindra Shrestha University of Houston – Clear Lake.
Chapter 2 Variables.
Variables and Constants Objectives F To understand Identifiers, Variables, and Constants.
COMP 102 Programming Fundamentals I Presented by : Timture Choi COMP102 Lab 011.
Chapter 8 Characters and Strings. Objectives In this chapter, you will learn: –To be able to use the functions of the character handling library ( ctype).
Types Chapter 2. C++ An Introduction to Computing, 3rd ed. 2 Objectives Observe types provided by C++ Literals of these types Explain syntax rules for.
Characters and Strings
Chapter 2. Variable and Data type
Variables in C Topics  Naming Variables  Declaring Variables  Using Variables  The Assignment Statement Reading  Sections
CMSC 104, Version 8/061L09VariablesInC.ppt Variables in C Topics Naming Variables Declaring Variables Using Variables The Assignment Statement Reading.
UNIMAP Sem2-07/08EKT120: Computer Programming1 Week 2 – Introduction to Programming.
Sudeshna Sarkar, IIT Kharagpur 1 Programming and Data Structure Sudeshna Sarkar Lecture 3.
1 Types of Programming Language (1) Three types of programming languages 1.Machine languages Strings of numbers giving machine specific instructions Example:
BASIC C PROGRAMMING LANGUAGE TUTORIAL infobizzs.com.
Chapter 1 slides1 What is C? A high-level language that is extremely useful for engineering computations. A computer language that has endured for almost.
INTRODUCTION TO PROGRAMING System Development Mansoura October 2015.
Chapter # 2 Part 2 Programs And data
CIS3931 – Intro to JAVA Lecture Note Set 2 17-May-05.
BASIC ELEMENTS OF A COMPUTER PROGRAM
Chapter 1 Introduction to C Programming
© 2016 Pearson Education, Ltd. All rights reserved.
Documentation Need to have documentation in all programs
C Language VIVA Questions with Answers
Revision Lecture
ICS103 Programming in C Lecture 3: Introduction to C (2)
DCP2073 Asas Pengaturcaraan C Lecture 6: Components of a C Program (Part 3) Lecture 6: C Primitives 6.
Getting Started with C.
BY GAWARE S.R. COMPUTER SCI. DEPARTMENT
Lecture2.
By: Syed Shahrukh Haider
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.
Tejalal Choudhary “Computer Programming” Fundamentals of “C”
Introduction to C++ Programming
C++ Data Types Data Type
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.
Chapter 2: Java Fundamentals
C ( Programming Language ) PSK Technologies By: Arti Sontakke An ISO 9001:2015 (QMS) Certified IT Company Computer Education | Software Development | Computer.
The C Language: Intro.
C – Programming Language
Chapter 2 Primitive Data Types and Operations
Variables in C Topics Naming Variables Declaring Variables
Variables and Constants
Getting Started With Coding
Presentation transcript:

Chapter 1 Introduction to C Programming REV00 REV00 Chapter 1 Introduction to C Programming DDC1123 PENGATURCARAAN I (C)

1.1 Introduction We will learn the C programming language REV00 1.1 Introduction We will learn the C programming language Learn structured programming and proper programming techniques. This course is appropriate for technically oriented people with little or no programming experience. Experienced programmers who want a deep and rigorous treatment of the language DDC1123 PENGATURCARAAN I (C)

REV00 1.2 History of C C Evolved by Ritchie from two previous. programming languages, BCPL and B Used to develop UNIX. Now, most operating systems written with C or C++. Hardware independent (portable). By late 1970's C had evolved to "Traditional C“. Standard created in 1989, updated in 1999 DDC1123 PENGATURCARAAN I (C)

REV00 1.3 Identifiers In C the names of variables, functions, labels and various others user defined items are called identifiers. The length of these identifiers can vary from one to several character The first character must be a letter or an underscore, and subsequent characters must be either letters, digits, or underscores. Use meaningful identifiers Be consistent DDC1123 PENGATURCARAAN I (C)

1.3.1 Correct and Incorrect Identifiers names REV00 1.3.1 Correct and Incorrect Identifiers names Correct Incorrect count 1count test123 Hi!there High_balance High…balance Total_score Total+score DDC1123 PENGATURCARAAN I (C)

REV00 1.4 Basic Data Types Data is information that maybe manipulated by computer A binary digit, or a bit is the smallest item of data Type Size (bytes) char 1 int 2 or 4 float 4 double 8 DDC1123 PENGATURCARAAN I (C)

10 a 1.5 Declaring Variables Declaration: REV00 int a = 10; Type Name Value 10 a Memory location DDC1123 PENGATURCARAAN I (C)

REV00 1.6 Constants Constant refer to fixed values that the program may not alter. Constant can be any of the basic data types. Declaration: #define PI 3.142; Keyword Value Name DDC1123 PENGATURCARAAN I (C)

1.7 Formatted Input/Output REV00 1.7 Formatted Input/Output Standard Output with printf( ) Syntax: printf ("Hello World!"); or printf ("Number: %d", a); Hello World! output Number: 10 output DDC1123 PENGATURCARAAN I (C)

1.7 Formatted Input/Output REV00 1.7 Formatted Input/Output Format specifiers: printf ("Number: %d", a); %d is a format specifier that indicates the data should be of type integer. DDC1123 PENGATURCARAAN I (C)

1.7 Formatted Input/Output REV00 1.7 Formatted Input/Output Standard Input with scanf( ) Syntax: scanf ("%d", &a); Input a Memory location DDC1123 PENGATURCARAAN I (C)