Unit I C Language Review Ref. Book: Yashavant Kanetkar, “Let Us C”, BPB Publications, 10/E, 2010.

Slides:



Advertisements
Similar presentations
 2000 Prentice Hall, Inc. All rights reserved. Chapter 2 - Introduction to C Programming Outline 2.1Introduction 2.2A Simple C Program: Printing a Line.
Advertisements

Introduction to C Programming
Programing Concept Ken Youssefi/Ping HsuIntroduction to Engineering – E10 1 ENGR 10 Introduction to Engineering (Part A)
Chapter 4 Control Structures I. Objectives ► Examine relational and logical operators ► Explore how to form and evaluate logical (Boolean) expressions.
IntroductionIntroduction  Computer program: an ordered sequence of statements whose objective is to accomplish a task.  Programming: process of planning.
 2007 Pearson Education, Inc. All rights reserved Introduction to C Programming.
 2000 Prentice Hall, Inc. All rights reserved. Chapter 3 - Structured Program Development Outline 3.1Introduction 3.2Algorithms 3.3Pseudocode 3.4Control.
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To understand the structure of a C-language program. ❏ To write your first C.
Structured Program Development in C
CONTROL STATEMENTS Lakhbir Singh(Lect.IT) S.R.S.G.P.C.G. Ludhiana.
 2003 Prentice Hall, Inc. All rights reserved. 1 Introduction to C++ Programming Outline Introduction to C++ Programming A Simple Program: Printing a.
Programing Concept Ken Youssefi/Ping HsuIntroduction to Engineering – E10 1 ENGR 10 Introduction to Engineering (Part A)
Application of Differential Applied Optimization Problems.
C Tokens Identifiers Keywords Constants Operators Special symbols.
1 4.8The do/while Repetition Structure The do/while repetition structure –Similar to the while structure –Condition for repetition tested after the body.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. A Concise Introduction to MATLAB ® William J. Palm III.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 2 Chapter 2 - Introduction to C Programming.
CIS-165 C++ Programming I CIS-165 C++ Programming I Bergen Community College Prof. Faisal Aljamal.
Course Title: Object Oriented Programming with C++ instructor ADEEL ANJUM Chapter No: 03 Conditional statement 1 BY ADEEL ANJUM (MSc-cs, CCNA,WEB DEVELOPER)
Dennis Ritchie 1972 AT & T Bell laboratories (American Telephone and Telegraph) USA 1www.gowreeswar.com.
Chapter 3 - Structured Program Development Outline 3.1Introduction 3.2Algorithms 3.3Pseudocode 3.4Control Structures 3.5The If Selection Structure 3.6The.
Chapter 7 Selection Dept of Computer Engineering Khon Kaen University.
Structured Program Development Angela Chih-Wei Tang ( 唐 之 瑋 ) Department of Communication Engineering National Central University JhongLi, Taiwan 2010.
BE207 Numerical Analysis using Matlab Lecturer DR Abdullah Awad Faculty of Engineering.
School of Computer Science & Information Technology G6DICP - Lecture 4 Variables, data types & decision making.
Types of C Variables:  The following are some types of C variables on the basis of constants values it has. For example: ○ An integer variable can hold.
1 Programming a Computer Lecture Ten. 2 Outline  A quick introduction to the programming language C  Introduction to software packages: Matlab for numerical.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Chapter 2 - Introduction to C Programming Outline.
Control structures in C by Dr P.Padmanabham Professor (CSE)&Director Bharat Institute of Engineering &Technology Hyderabad Mobile
 2003 Prentice Hall, Inc. All rights reserved. 1 Basic C++ Programming.
Java Basics. Tokens: 1.Keywords int test12 = 10, i; int TEst12 = 20; Int keyword is used to declare integer variables All Key words are lower case java.
1 Lecture 2 - Introduction to C Programming Outline 2.1Introduction 2.2A Simple C Program: Printing a Line of Text 2.3Another Simple C Program: Adding.
Chapter 2 Variables and Constants. Objectives Explain the different integer variable types used in C++. Declare, name, and initialize variables. Use character.
Systems of Linear Equations: Matrices
SKMM1013 Programming for Engineers
Program design Program Design Process has 2 phases:
Outcome based Learning Objectives
Chapter 4 C Program Control Part I
BASIC ELEMENTS OF A COMPUTER PROGRAM
Chapter 2 - Introduction to C Programming
MatLab Programming By Kishan Kathiriya.
ITEC113 Algorithms and Programming Techniques
Chapter 4 MATLAB Programming
C++, OBJECT ORIENTED PROGRAMMING
BY GAWARE S.R. COMPUTER SCI. DEPARTMENT
Chapter 2 - Introduction to C Programming
MATLAB DENC 2533 ECADD LAB 9.
An Introduction to Maple
Introduction to the C Language
Chapter 2 - Introduction to C Programming
Chapter 2 - Introduction to C Programming
Introduction to Programming
Character Set The character set of C represents alphabet, digit or any symbol used to represent information. Types Character Set Uppercase Alphabets A,
ME 123 Computer Applications I Lecture 24: Character Strings 4/18/03
Chapter 2 - Introduction to C Programming
Structured Program
Programming Funamental slides
Chapter 3 - Structured Program Development
Introduction to Algorithms and Programming
Chapter 3 - Structured Program Development
Chapter 2 - Introduction to C Programming
Vectors and Matrices In MATLAB a vector can be defined as row vector or as a column vector. A vector of length n can be visualized as matrix of size 1xn.
Chapter 2 - Introduction to C Programming
Introduction to Programming
DATA TYPES There are four basic data types associated with variables:
C Language B. DHIVYA 17PCA140 II MCA.
Course Outcomes of Programming In C (PIC) (17212, C203):
Introduction to C Programming
ME 123 Computer Applications I Lecture 25: MATLAB Overview 4/28/03
Variables and Constants
Presentation transcript:

Unit I C Language Review Ref. Book: Yashavant Kanetkar, “Let Us C”, BPB Publications, 10/E, 2010

Contents 1.Algorithms, flowcharts 2.Data types in C 3.The C character set: Constants, Variables and keywords 4.Decision Control

Algorithm and Flowchart A sequential solution of any program that written in human language, called algorithm. Algorithm is first step of the solution process, after the analysis of problem, programmer write the algorithm of that problem. Graphical representation of any program is called flowchart.

Symbols Used in flowchart

Algorithm 1.Start 2.Input Current ( I ) and resistance( R) 3.Calculate voltage V= I*R 4.Display the voltage, V 5.Stop

Start Calculate V= I * R Input I and R Print V Stop

Data Types in C Variable TypeKeywordByte reqdRangeFormat Character (signed) char1-128 to +127%c Integer ( Signed) int to %d Float ( signed)float4-3.4e30 to + 3.4e38%f Doubledouble8-1.7e308 to + 1.7e308%lf Long Integerlong to %ld Character ( unsigned) unsigned char10 to 255%c Integer ( unsigned) unsigned int20 to 65535%u Unsigned long integer Unsigned long40 to %lu Long Doublelong double10-1.7e932 to +1.7e932%lf

Constants, Variables, Keyword Smallest individual unit value that does not change during the execution of a program e.G PI,”Ram”, “a” A variable is a name, given to a temporary memory location that has been used to store any value. e.g salary, a,b,A,B etc. Keywords are the words whose meaning has already been explained to the compiler. e.g if, else, break, switch,int,float, union etc

Decision control if statement if else statement Nested if statement switch case statement

if statement If (this condition (expression) is true ) { execute this statement; } Expression is true if x == y x is equal to y x !=y x is not equal to y x y x is greater than y x = y x is greater than or equal to y if (per < 40 ) { printf ( “fail” ) } if ( per >=40 && per <=50) { printf(“Pass class”); }

if else if(condition) { statements; } else { statements; } if ( remainder is zero) { printf(“Even number”); } else { printf(“Odd number”); }

Nested if

switch case switch(2) { case 1: statement 1; break; case 2: Statement 2; break; }

Unit II Program Development concepts Ref. Book: Yashavant Kanetkar, “Let Us C”, BPB Publications, 10/E, 2010

contents The loop control structure Functions and pointers Arrays

Loop Control Structure Looping : – while loop – do while loop – for loop Loop Control – break -- exit from loop or switch. – continue -- skip 1 iteration of loop.

Unit III Numerical computational techniques 1 a. Solution of transcendental & polynomial equation. b. Solution of bisection method. c. Solution of Newton Raphson method. Ref. Book: S.S. Shashtry, “Introductory Methods of Numerical”, Tata McGraw Hill.

Unit IV Numerical computational techniques 2 a. Solution of secant method. b. Solution of linear equations using Gauss elimination method and Gauss-Jordan methods. c. Numerical integration and differentiation: trapezoidal rule Simpson's 1/3 and 3/8 rule.. Ref. Book: S.S. Sastry, “Introductory Methods of Numerical”, Tata McGraw Hill.

Unit V MATLAB a. Introduction, Basics of MATLAB b. Working with arrays of numbers c. Creating and printing simple plots d. Creating and executing a Script file, function file. e. Interactive computations: Matrices and vectors, Matrix and array operation. f. Graphics: Basic 2-D plots, 3-D plots. MATLAB Release Notes for Release 12, The Math Works, Inc., 2000.

Practical List 1. Bisection Method program. 2. Secant Method program. 3. Newton Raphson Method program. 4. Gauss Elimination Method Program. 5. Gauss seidal Method Program. 6. Simpson`s 1/3 rd and 3/8 th rule program. 7. Arithmetic operations on matrix using MATLAB. 8. Plot the simple, 2-D and 3-D plots using MATLAB. 9. Find the roots of polynomial equations using MATLAB. 10. Find eigenvalues and eigenvectors, LU factorization. Note: Lab file should consist of minimum Eight experiments.