C Programming. Course Outline. C Programming. Code: MBD101. Duration: 10 Hours. Prerequisites:

Size: px
Start display at page:

Download "C Programming. Course Outline. C Programming. Code: MBD101. Duration: 10 Hours. Prerequisites:"

Transcription

1 C Programming Code: MBD101 Duration: 10 Hours Prerequisites: You are a computer science Professional/ graduate student You can execute Linux/UNIX commands You know how to use a text-editing tool You should have your own laptop installed with Ubuntu Course Outline C Programming 1. The C Language 1. C Program Compilation 2. Execution Process 3. Tokens of C Program 4. C Instructions 5. Constants, Variables 6. Identifiers and Keywords 7. Primitive Data Types 8. Structures The Definition 9. Structures Declaration & Type 10. Accessing Elements of Structure 11. Range of Signed/Unsigned Data-types 12. Efficient way of Printing Pointer 13. Compiler Memory Allocation for Data-types 14. Compiler Memory Allocation for Structures 15. Data-type Alignments 16. Compiler Memory Allocation for Unions 17. Union Data Corruption 18. Practical Usage of Unions 19. Practical Usage of Bitfields 20. Bitfields Overflow 21. Printing every byte of an Integer 22. Enumeration 23. Typedef Statements 24. Practical example of Typedef Usage SateeshKG Page 1

2 25. typedef ing a Function Pointer 26. Bit-Fields in Structure 27. Practical examples of Bitfield Usage 28. Structure Padding & Pitfalls 29. Programming Model & Memory Sizes 30. Why Sizeof Int and Long is 4 or 8? 31. Use of long long in 32-bit Architecture 32. Practical Example of long long 33. IA-32, IA-64, ILP-32, LP64, x Array Representation 35. Array Memory Allocation 36. Array Declaration & Initialization 37. Two Dimensional Arrays 2. Pointers 1. Accessing a Variable Through Pointer 2. Pointer Memory Allocation 3. Pointer Declaration & Initialization 4. Pointer Dereferencing 5. Pointers & Arrays 6. Character Arrays using Pointers 7. Array of Character Pointers 8. Memory Diagram Array of Char Pointers 9. Arrays as Pointers a[i] == i[a]? 3. Constant Pointers 1. Pointer Arithmetic 2. String Handling Functions 3. String Conversion Functions 4. Efficient usage of sscanf()/sprintf() 4. Computing Basic 1. Binary & Octal Systems 2. Decimal & Hexadecimal Systems 3. Signed Representations in Memory 4. Binary Shifts Right & Left 5. Sign Bits and Bit-Shift Operations 6. Right Shift Logical Vs Arithmetic Shift 7. Bit-Shift Overflow 8. ASCII Representations 9. Endian-ness Little Vs Big 10. Endian-ness Portability Issues 5. Operators 1. Bitwise Operations 2. Logical Operators Short Circuit 3. Bitwise Vs Logical Operations 4. sizeof() operator 5. Pitfalls/Issues with sizeof() usage 6. Pointer Increment & Scaling 7. Operator Precedence 8. Operator Associativity SateeshKG Page 2

3 9. True meaning of Associativity 10. Examples of Precedence & Associativity 11. Ternary Operator Associativity Rule 12. Data-type Conversion Rules 13. Float to Int to Float Conversions 14. Variadic functions & default promotion rules 15. Printf Idiosynchracies 16. Pointer Format Specifiers 17. Signed Vs Unsigned Pitfalls 18. Evaluation of i = ++i + ++i 19. Evaluation of i = ++i + ++i + ++i 20. Concept of Sequence Points 21. Example of Sequence Points 6. Storage Classes 1. Storage Class Specifiers 2. Scope of a Variable 3. Register, Auto, Static, Extern 4. Why Register Class and Practical Examples 5. Automatic Variables and Stack 6. Static Variables and Functions 7. True meaning of Extern 8. How to Use extern across Multiple Files with Examples 9. Best Practices for Extern Usage 10. Local/Block/Global Scope 11. Nesting of Scope 12. Lifetime of a Variable 13. Linkage of a Variable 14. What is Const? 7. Practical Examples of Const Qualifier 1. Usage of Constant in library functions (libc) 2. What is Volatile? 3. Practical Examples of Volatile Qualifier 4. Const Volatile Together? 5. Register Vs Volatile Performance? 6. Practical Examples of Const Volatile 7. Pointer Aliasing 8. What is Restrict Qualifier? 9. Restrict Keyword and Compiler Optimization 10. Examples of Restrict Qualifier 8. Memory 1. Dynamic Memory Allocations 2. malloc, calloc, realloc, free 3. malloc Vs calloc 4. Heap Memory 5. Stack Memory Pitfalls 6. Dangling Pointers 7. DMA Errors 8. Best Practices for malloc() & free() SateeshKG Page 3

4 9. DMA Unspecified Behaviour 9. Functions & Pointers 1. Invoking Functions 2. Passing Arguments to Functions 3. Call by Value & Reference 4. Is C call by Value? 5. Is C call by Reference? 6. Array as Function Argument 7. Rules for Array Argument Passing 8. Multi-dimensional Array Argument Passing 9. Structure as Function Argument 10. Static Vs Dynamic Runtime Environment 11. Function Call and Runtime Stack 12. Rules for Evaluation of Function Arguments 10. Memory Organization 1. Code Segment 2. Data Segment 3. Heap Segment 4. Stack Segment 5. free space 6. register space 7. Stack Frames 8. Calling Sequence 9. View of Runtime Stack with Example 10. Access to Local Variable in Stack 11. Local Temporaries 11. Function Pointers 1. Declaration and Usage of Function Pointers 2. Function Pointers as Function Parameters 3. Practical Example of Function Pointers 4. Pointer to an Integer Array 12. C Pointers Complexity Chart 1. int **p 2. int (*p)() 3. int (*p)[] int *p() 4. int *(*p[])() 5. int *(**p)[] 13. Preprocessor 1. Preprocessor #include statements 2. Multiple Inclusion of a Header File? 3. Preprocessor #define statements 4. Preprocessor Conditional Compilation 5. Preprocessor Nested Macros 6. Preprocessor Multiline Macros 7. Preprocessor Stringizer 8. Preprocessor Token Concatenation 9. Preprocessor Useful Directives 10. Conditional Directives for Debugging SateeshKG Page 4

5 11. Where Macros are Heavily Used 12. Practical Examples of Macros 13. Macros Pitfalls 14. Macros Vs Enums 15. Inline Functions 16. Macros Vs Inline 17. Inline Recursive Functions 14. Command Line Argument 1. Environment Variables in C Programs 2. Recursion Example 3. Recursion Vs Iteration 4. Code/Space/Time Complexity 15. Standard I/O Library 1. Files & Streams 2. Streams Buffers 3. IO Buffers Line Vs Full Vs No-Buffers 4. Setting & Flushing Buffers 5. File Access 6. File Access Modes 7. Sequential Vs Random Access 8. Concept of File Offsets 9. File Operation Errors 10. End-of-File Condition? 11. Return Values and Error Values 12. Character Based File I/O 13. Line Based File I/O 14. Formatted File I/O 15. Block File I/O 16. Dangerous gets() Vs fgets() 17. File Random Access Methods ** These sections may be considered in part or in whole as optional. They contain background reference material, specialized topics, or advanced subjects. The instructor may choose to cover or not cover them depending on classroom experience and time constraints. SateeshKG Page 5

About Codefrux While the current trends around the world are based on the internet, mobile and its applications, we try to make the most out of it. As for us, we are a well established IT professionals

More information

C Programming SYLLABUS COVERAGE SYLLABUS IN DETAILS

C Programming SYLLABUS COVERAGE SYLLABUS IN DETAILS C Programming C SYLLABUS COVERAGE Introduction to Programming Fundamentals in C Operators and Expressions Data types Input-Output Library Functions Control statements Function Storage class Pointer Pointer

More information

DETAILED SYLLABUS INTRODUCTION TO C LANGUAGE

DETAILED SYLLABUS INTRODUCTION TO C LANGUAGE COURSE TITLE C LANGUAGE DETAILED SYLLABUS SR.NO NAME OF CHAPTERS & DETAILS HOURS ALLOTTED 1 INTRODUCTION TO C LANGUAGE About C Language Advantages of C Language Disadvantages of C Language A Sample Program

More information

Contents. Preface. Introduction. Introduction to C Programming

Contents. Preface. Introduction. Introduction to C Programming c11fptoc.fm Page vii Saturday, March 23, 2013 4:15 PM Preface xv 1 Introduction 1 1.1 1.2 1.3 1.4 1.5 Introduction The C Programming Language C Standard Library C++ and Other C-Based Languages Typical

More information

CSCI 171 Chapter Outlines

CSCI 171 Chapter Outlines Contents CSCI 171 Chapter 1 Overview... 2 CSCI 171 Chapter 2 Programming Components... 3 CSCI 171 Chapter 3 (Sections 1 4) Selection Structures... 5 CSCI 171 Chapter 3 (Sections 5 & 6) Iteration Structures

More information

Writing an ANSI C Program Getting Ready to Program A First Program Variables, Expressions, and Assignments Initialization The Use of #define and

Writing an ANSI C Program Getting Ready to Program A First Program Variables, Expressions, and Assignments Initialization The Use of #define and Writing an ANSI C Program Getting Ready to Program A First Program Variables, Expressions, and Assignments Initialization The Use of #define and #include The Use of printf() and scanf() The Use of printf()

More information

Review of the C Programming Language for Principles of Operating Systems

Review of the C Programming Language for Principles of Operating Systems Review of the C Programming Language for Principles of Operating Systems Prof. James L. Frankel Harvard University Version of 7:26 PM 4-Sep-2018 Copyright 2018, 2016, 2015 James L. Frankel. All rights

More information

IMPORTANT QUESTIONS IN C FOR THE INTERVIEW

IMPORTANT QUESTIONS IN C FOR THE INTERVIEW IMPORTANT QUESTIONS IN C FOR THE INTERVIEW 1. What is a header file? Header file is a simple text file which contains prototypes of all in-built functions, predefined variables and symbolic constants.

More information

M1-R4: Programing and Problem Solving using C (JULY 2018)

M1-R4: Programing and Problem Solving using C (JULY 2018) M1-R4: Programing and Problem Solving using C (JULY 2018) Max Marks: 100 M1-R4-07-18 DURATION: 03 Hrs 1. Each question below gives a multiple choice of answers. Choose the most appropriate one and enter

More information

Review of the C Programming Language

Review of the C Programming Language Review of the C Programming Language Prof. James L. Frankel Harvard University Version of 11:55 AM 22-Apr-2018 Copyright 2018, 2016, 2015 James L. Frankel. All rights reserved. Reference Manual for the

More information

P.G.TRB - COMPUTER SCIENCE. c) data processing language d) none of the above

P.G.TRB - COMPUTER SCIENCE. c) data processing language d) none of the above P.G.TRB - COMPUTER SCIENCE Total Marks : 50 Time : 30 Minutes 1. C was primarily developed as a a)systems programming language b) general purpose language c) data processing language d) none of the above

More information

The Waite Group's. New. Primer Plus. Second Edition. Mitchell Waite and Stephen Prata SAMS

The Waite Group's. New. Primer Plus. Second Edition. Mitchell Waite and Stephen Prata SAMS The Waite Group's New Primer Plus Second Edition Mitchell Waite and Stephen Prata SAMS PUBLISHING A Division of Prentice Hall Computer Publishing 11711 North College, Carmel, Indiana 46032 USA Contents

More information

Variables Data types Variable I/O. C introduction. Variables. Variables 1 / 14

Variables Data types Variable I/O. C introduction. Variables. Variables 1 / 14 C introduction Variables Variables 1 / 14 Contents Variables Data types Variable I/O Variables 2 / 14 Usage Declaration: t y p e i d e n t i f i e r ; Assignment: i d e n t i f i e r = v a l u e ; Definition

More information

Computers Programming Course 5. Iulian Năstac

Computers Programming Course 5. Iulian Năstac Computers Programming Course 5 Iulian Năstac Recap from previous course Classification of the programming languages High level (Ada, Pascal, Fortran, etc.) programming languages with strong abstraction

More information

CHAPTER 1 Introduction to Computers and Programming CHAPTER 2 Introduction to C++ ( Hexadecimal 0xF4 and Octal literals 031) cout Object

CHAPTER 1 Introduction to Computers and Programming CHAPTER 2 Introduction to C++ ( Hexadecimal 0xF4 and Octal literals 031) cout Object CHAPTER 1 Introduction to Computers and Programming 1 1.1 Why Program? 1 1.2 Computer Systems: Hardware and Software 2 1.3 Programs and Programming Languages 8 1.4 What is a Program Made of? 14 1.5 Input,

More information

CS Programming In C

CS Programming In C CS 24000 - Programming In C Week Two: Basic C Program Organization and Data Types Zhiyuan Li Department of Computer Science Purdue University, USA 2 int main() { } return 0; The Simplest C Program C programs

More information

A S H O R T I S H O V E R V I E W O F T H E A N S I C P R O G R A M M I N G L A N G U A G E

A S H O R T I S H O V E R V I E W O F T H E A N S I C P R O G R A M M I N G L A N G U A G E A S H O R T I S H O V E R V I E W O F T H E A N S I C P R O G R A M M I N G L A N G U A G E IDENTIFIERS Identifiers are names of variables, functions, defined types, structures and unions, enumeration

More information

Index. object lifetimes, and ownership, use after change by an alias errors, use after drop errors, BTreeMap, 309

Index. object lifetimes, and ownership, use after change by an alias errors, use after drop errors, BTreeMap, 309 A Arithmetic operation floating-point arithmetic, 11 12 integer numbers, 9 11 Arrays, 97 copying, 59 60 creation, 48 elements, 48 empty arrays and vectors, 57 58 executable program, 49 expressions, 48

More information

Model Viva Questions for Programming in C lab

Model Viva Questions for Programming in C lab Model Viva Questions for Programming in C lab Title of the Practical: Assignment to prepare general algorithms and flow chart. Q1: What is a flowchart? A1: A flowchart is a diagram that shows a continuous

More information

A Fast Review of C Essentials Part I

A Fast Review of C Essentials Part I A Fast Review of C Essentials Part I Structural Programming by Z. Cihan TAYSI Outline Program development C Essentials Functions Variables & constants Names Formatting Comments Preprocessor Data types

More information

XC Specification. 1 Lexical Conventions. 1.1 Tokens. The specification given in this document describes version 1.0 of XC.

XC Specification. 1 Lexical Conventions. 1.1 Tokens. The specification given in this document describes version 1.0 of XC. XC Specification IN THIS DOCUMENT Lexical Conventions Syntax Notation Meaning of Identifiers Objects and Lvalues Conversions Expressions Declarations Statements External Declarations Scope and Linkage

More information

Short Notes of CS201

Short Notes of CS201 #includes: Short Notes of CS201 The #include directive instructs the preprocessor to read and include a file into a source code file. The file name is typically enclosed with < and > if the file is a system

More information

CS201 - Introduction to Programming Glossary By

CS201 - Introduction to Programming Glossary By CS201 - Introduction to Programming Glossary By #include : The #include directive instructs the preprocessor to read and include a file into a source code file. The file name is typically enclosed with

More information

Preface... (vii) CHAPTER 1 INTRODUCTION TO COMPUTERS

Preface... (vii) CHAPTER 1 INTRODUCTION TO COMPUTERS Contents Preface... (vii) CHAPTER 1 INTRODUCTION TO COMPUTERS 1.1. INTRODUCTION TO COMPUTERS... 1 1.2. HISTORY OF C & C++... 3 1.3. DESIGN, DEVELOPMENT AND EXECUTION OF A PROGRAM... 3 1.4 TESTING OF PROGRAMS...

More information

C-LANGUAGE CURRICULAM

C-LANGUAGE CURRICULAM C-LANGUAGE CURRICULAM Duration: 2 Months. 1. Introducing C 1.1 History of C Origin Standardization C-Based Languages 1.2 Strengths and Weaknesses Of C Strengths Weaknesses Effective Use of C 2. C Fundamentals

More information

BLM2031 Structured Programming. Zeyneb KURT

BLM2031 Structured Programming. Zeyneb KURT BLM2031 Structured Programming Zeyneb KURT 1 Contact Contact info office : D-219 e-mail zeynebkurt@gmail.com, zeyneb@ce.yildiz.edu.tr When to contact e-mail first, take an appointment What to expect help

More information

C & Data Structures syllabus

C & Data Structures syllabus syllabus Overview: C language which is considered the mother of all languages, is and will be the most sought after programming language for any beginner to jump start his career in software development.

More information

Motor Industry Software Reliability Association (MISRA) C:2012 Standard Mapping of MISRA C:2012 items to Goanna checks

Motor Industry Software Reliability Association (MISRA) C:2012 Standard Mapping of MISRA C:2012 items to Goanna checks Goanna 3.3.2 Standards Data Sheet for MISRA C:2012 misrac2012-datasheet.pdf Motor Industry Software Reliability Association (MISRA) C:2012 Standard Mapping of MISRA C:2012 items to Goanna checks The following

More information

Practical C++ Programming

Practical C++ Programming SECOND EDITION Practical C++ Programming Steve Oualline O'REILLY' Beijing Cambridge Farnham Koln Paris Sebastopol Taipei Tokyo Preface xv Part I. The Basics 1. What Is C++? 3 A Brief History of C++ 3 C++

More information

Ch. 3: The C in C++ - Continued -

Ch. 3: The C in C++ - Continued - Ch. 3: The C in C++ - Continued - QUIZ What are the 3 ways a reference can be passed to a C++ function? QUIZ True or false: References behave like constant pointers with automatic dereferencing. QUIZ What

More information

L2 - C language for Embedded MCUs

L2 - C language for Embedded MCUs Formation C language for Embedded MCUs: Learning how to program a Microcontroller (especially the Cortex-M based ones) - Programmation: Langages L2 - C language for Embedded MCUs Learning how to program

More information

EL6483: Brief Overview of C Programming Language

EL6483: Brief Overview of C Programming Language EL6483: Brief Overview of C Programming Language EL6483 Spring 2016 EL6483 EL6483: Brief Overview of C Programming Language Spring 2016 1 / 30 Preprocessor macros, Syntax for comments Macro definitions

More information

MPATE-GE 2618: C Programming for Music Technology. Syllabus

MPATE-GE 2618: C Programming for Music Technology. Syllabus MPATE-GE 2618: C Programming for Music Technology Instructor Dr. Schuyler Quackenbush schuyler.quackenbush@nyu.edu Lab Teaching Assistant TBD Description Syllabus MPATE-GE 2618: C Programming for Music

More information

Fundamental Data Types. CSE 130: Introduction to Programming in C Stony Brook University

Fundamental Data Types. CSE 130: Introduction to Programming in C Stony Brook University Fundamental Data Types CSE 130: Introduction to Programming in C Stony Brook University Program Organization in C The C System C consists of several parts: The C language The preprocessor The compiler

More information

Data Storage. August 9, Indiana University. Geoffrey Brown, Bryce Himebaugh 2015 August 9, / 19

Data Storage. August 9, Indiana University. Geoffrey Brown, Bryce Himebaugh 2015 August 9, / 19 Data Storage Geoffrey Brown Bryce Himebaugh Indiana University August 9, 2016 Geoffrey Brown, Bryce Himebaugh 2015 August 9, 2016 1 / 19 Outline Bits, Bytes, Words Word Size Byte Addressable Memory Byte

More information

Fundamentals of Programming

Fundamentals of Programming Fundamentals of Programming Lecture 3 - Constants, Variables, Data Types, And Operations Lecturer : Ebrahim Jahandar Borrowed from lecturer notes by Omid Jafarinezhad Outline C Program Data types Variables

More information

CS201 Some Important Definitions

CS201 Some Important Definitions CS201 Some Important Definitions For Viva Preparation 1. What is a program? A program is a precise sequence of steps to solve a particular problem. 2. What is a class? We write a C++ program using data

More information

Contents of Lecture 3

Contents of Lecture 3 Contents of Lecture 3 Repetition of matrices double a[3][4]; double* b; double** c; Terminology Linkage Types Conversions Jonas Skeppstedt (js@cs.lth.se) Lecture 3 2014 1 / 33 A global matrix: double a[3][4]

More information

C Programming Language (Chapter 2 of K&R) Variables and Constants

C Programming Language (Chapter 2 of K&R) Variables and Constants C Programming Language (Chapter 2 of K&R) Types, Operators and Expressions Variables and Constants Basic objects manipulated by programs Declare before use: type var1, var2, int x, y, _X, x11, buffer;

More information

Practical C Programming. Steve Oualline

Practical C Programming. Steve Oualline Practical C Programming Steve Oualline Preface Scope of This Handbook Conventions Used in This Handbook Acknowledgments xviii xix xx i xxii Chapter 1 The Basics of Program Writing 1 Text Editor 2 Compiler

More information

Aryan College. Fundamental of C Programming. Unit I: Q1. What will be the value of the following expression? (2017) A + 9

Aryan College. Fundamental of C Programming. Unit I: Q1. What will be the value of the following expression? (2017) A + 9 Fundamental of C Programming Unit I: Q1. What will be the value of the following expression? (2017) A + 9 Q2. Write down the C statement to calculate percentage where three subjects English, hindi, maths

More information

A flow chart is a graphical or symbolic representation of a process.

A flow chart is a graphical or symbolic representation of a process. Q1. Define Algorithm with example? Answer:- 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

More information

Binghamton University. CS-211 Fall Syntax. What the Compiler needs to understand your program

Binghamton University. CS-211 Fall Syntax. What the Compiler needs to understand your program Syntax What the Compiler needs to understand your program 1 Pre-Processing Any line that starts with # is a pre-processor directive Pre-processor consumes that entire line Possibly replacing it with other

More information

MISRA-C:2012 Standards Model Summary for C / C++

MISRA-C:2012 Standards Model Summary for C / C++ Version 9.7.1 Copyright 2017 Ltd. MISRA-C:2012 s Model Summary for C / C++ The tool suite is developed and certified to BS EN ISO 9001:2000 and SGS-TÜV Saar. This information is applicable to version 9.7.1

More information

PERIYAR CENTENARY POLYTECHNIC COLLEGE Periyar Nagar- Vallam Thanjavur

PERIYAR CENTENARY POLYTECHNIC COLLEGE Periyar Nagar- Vallam Thanjavur PERIYAR CENTENARY POLYTECHNIC COLLEGE Periyar Nagar- Vallam-613 403 Thanjavur 01. Define program? 02. What is program development cycle? 03. What is a programming language? 04. Define algorithm? 05. What

More information

edunepal_info

edunepal_info facebook.com/edunepal.info @ edunepal_info C interview questions (1 125) C interview questions are given with the answers in this website. We have given C interview questions faced by freshers and experienced

More information

Lecture 3: C Programm

Lecture 3: C Programm 0 3 E CS 1 Lecture 3: C Programm ing Reading Quiz Note the intimidating red border! 2 A variable is: A. an area in memory that is reserved at run time to hold a value of particular type B. an area in memory

More information

CprE 288 Introduction to Embedded Systems Exam 1 Review. 1

CprE 288 Introduction to Embedded Systems Exam 1 Review.  1 CprE 288 Introduction to Embedded Systems Exam 1 Review http://class.ece.iastate.edu/cpre288 1 Overview of Today s Lecture Announcements Exam 1 Review http://class.ece.iastate.edu/cpre288 2 Announcements

More information

Introduction to C++ Introduction. Structure of a C++ Program. Structure of a C++ Program. C++ widely-used general-purpose programming language

Introduction to C++ Introduction. Structure of a C++ Program. Structure of a C++ Program. C++ widely-used general-purpose programming language Introduction C++ widely-used general-purpose programming language procedural and object-oriented support strong support created by Bjarne Stroustrup starting in 1979 based on C Introduction to C++ also

More information

The Foundation of C++: The C Subset An Overview of C p. 3 The Origins and History of C p. 4 C Is a Middle-Level Language p. 5 C Is a Structured

The Foundation of C++: The C Subset An Overview of C p. 3 The Origins and History of C p. 4 C Is a Middle-Level Language p. 5 C Is a Structured Introduction p. xxix The Foundation of C++: The C Subset An Overview of C p. 3 The Origins and History of C p. 4 C Is a Middle-Level Language p. 5 C Is a Structured Language p. 6 C Is a Programmer's Language

More information

VALLIAMMAI ENGINEERING COLLEGE SRM NAGAR, KATTANGULATHUR

VALLIAMMAI ENGINEERING COLLEGE SRM NAGAR, KATTANGULATHUR VALLIAMMAI ENGINEERING COLLEGE SRM NAGAR, KATTANGULATHUR 603 203 FIRST SEMESTER B.E / B.Tech., (Common to all Branches) QUESTION BANK - GE 6151 COMPUTER PROGRAMMING UNIT I - INTRODUCTION Generation and

More information

High Performance Computing in C and C++

High Performance Computing in C and C++ High Performance Computing in C and C++ Rita Borgo Computer Science Department, Swansea University Summary Introduction to C Writing a simple C program Compiling a simple C program Running a simple C program

More information

Introduction to C++ with content from

Introduction to C++ with content from Introduction to C++ with content from www.cplusplus.com 2 Introduction C++ widely-used general-purpose programming language procedural and object-oriented support strong support created by Bjarne Stroustrup

More information

Data Representation and Storage. Some definitions (in C)

Data Representation and Storage. Some definitions (in C) Data Representation and Storage Learning Objectives Define the following terms (with respect to C): Object Declaration Definition Alias Fundamental type Derived type Use pointer arithmetic correctly Explain

More information

Fundamental of Programming (C)

Fundamental of Programming (C) Borrowed from lecturer notes by Omid Jafarinezhad Fundamental of Programming (C) Lecturer: Vahid Khodabakhshi Lecture 3 Constants, Variables, Data Types, And Operations Department of Computer Engineering

More information

Introduction to Programming Using Java (98-388)

Introduction to Programming Using Java (98-388) Introduction to Programming Using Java (98-388) Understand Java fundamentals Describe the use of main in a Java application Signature of main, why it is static; how to consume an instance of your own class;

More information

Tokens, Expressions and Control Structures

Tokens, Expressions and Control Structures 3 Tokens, Expressions and Control Structures Tokens Keywords Identifiers Data types User-defined types Derived types Symbolic constants Declaration of variables Initialization Reference variables Type

More information

Data Structures Unit 02

Data Structures Unit 02 Data Structures Unit 02 Bucharest University of Economic Studies Memory classes, Bit structures and operators, User data types Memory classes Define specific types of variables in order to differentiate

More information

OBJECTIVE QUESTIONS: Choose the correct alternative:

OBJECTIVE QUESTIONS: Choose the correct alternative: OBJECTIVE QUESTIONS: Choose the correct alternative: 1. Function is data type a) Primary b) user defined c) derived d) none 2. The declaration of function is called a) function prototype b) function call

More information

Appendix. Grammar. A.1 Introduction. A.2 Keywords. There is no worse danger for a teacher than to teach words instead of things.

Appendix. Grammar. A.1 Introduction. A.2 Keywords. There is no worse danger for a teacher than to teach words instead of things. A Appendix Grammar There is no worse danger for a teacher than to teach words instead of things. Marc Block Introduction keywords lexical conventions programs expressions statements declarations declarators

More information

Character Set. The character set of C represents alphabet, digit or any symbol used to represent information. Digits 0, 1, 2, 3, 9

Character Set. The character set of C represents alphabet, digit or any symbol used to represent information. Digits 0, 1, 2, 3, 9 Character Set The character set of C represents alphabet, digit or any symbol used to represent information. Types Uppercase Alphabets Lowercase Alphabets Character Set A, B, C, Y, Z a, b, c, y, z Digits

More information

M4.1-R3: PROGRAMMING AND PROBLEM SOLVING THROUGH C LANGUAGE

M4.1-R3: PROGRAMMING AND PROBLEM SOLVING THROUGH C LANGUAGE M4.1-R3: PROGRAMMING AND PROBLEM SOLVING THROUGH C LANGUAGE NOTE: 1. There are TWO PARTS in this Module/Paper. PART ONE contains FOUR questions and PART TWO contains FIVE questions. 2. PART ONE is to be

More information

CS 261 Fall C Introduction. Variables, Memory Model, Pointers, and Debugging. Mike Lam, Professor

CS 261 Fall C Introduction. Variables, Memory Model, Pointers, and Debugging. Mike Lam, Professor CS 261 Fall 2017 Mike Lam, Professor C Introduction Variables, Memory Model, Pointers, and Debugging The C Language Systems language originally developed for Unix Imperative, compiled language with static

More information

PESIT-BSC Department of Science & Humanities

PESIT-BSC Department of Science & Humanities LESSON PLAN 15PCD13/23 PROGRAMMING IN C AND DATA Course objectives: STRUCTURES The objective of this course is to make students to learn basic principles of Problem solving, implementing through C programming

More information

Main Program. C Programming Notes. #include <stdio.h> main() { printf( Hello ); } Comments: /* comment */ //comment. Dr. Karne Towson University

Main Program. C Programming Notes. #include <stdio.h> main() { printf( Hello ); } Comments: /* comment */ //comment. Dr. Karne Towson University C Programming Notes Dr. Karne Towson University Reference for C http://www.cplusplus.com/reference/ Main Program #include main() printf( Hello ); Comments: /* comment */ //comment 1 Data Types

More information

C++ (Non for C Programmer) (BT307) 40 Hours

C++ (Non for C Programmer) (BT307) 40 Hours C++ (Non for C Programmer) (BT307) 40 Hours Overview C++ is undoubtedly one of the most widely used programming language for implementing object-oriented systems. The C++ language is based on the popular

More information

In Java we have the keyword null, which is the value of an uninitialized reference type

In Java we have the keyword null, which is the value of an uninitialized reference type + More on Pointers + Null pointers In Java we have the keyword null, which is the value of an uninitialized reference type In C we sometimes use NULL, but its just a macro for the integer 0 Pointers are

More information

CPSC 3740 Programming Languages University of Lethbridge. Data Types

CPSC 3740 Programming Languages University of Lethbridge. Data Types Data Types A data type defines a collection of data values and a set of predefined operations on those values Some languages allow user to define additional types Useful for error detection through type

More information

Computer Organization & Systems Exam I Example Questions

Computer Organization & Systems Exam I Example Questions Computer Organization & Systems Exam I Example Questions 1. Pointer Question. Write a function char *circle(char *str) that receives a character pointer (which points to an array that is in standard C

More information

Reminder: compiling & linking

Reminder: compiling & linking Reminder: compiling & linking source file 1 object file 1 source file 2 compilation object file 2 library object file 1 linking (relocation + linking) load file source file N object file N library object

More information

C Introduction. Comparison w/ Java, Memory Model, and Pointers

C Introduction. Comparison w/ Java, Memory Model, and Pointers CS 261 Fall 2018 Mike Lam, Professor C Introduction Comparison w/ Java, Memory Model, and Pointers Please go to socrative.com on your phone or laptop, choose student login and join room LAMJMU The C Language

More information

Introduction to C Language (M3-R )

Introduction to C Language (M3-R ) Introduction to C Language (M3-R4-01-18) 1. Each question below gives a multiple choice of answers. Choose the most appropriate one and enter in OMR answer sheet supplied with the question paper, following

More information

1 P a g e A r y a n C o l l e g e \ B S c _ I T \ C \

1 P a g e A r y a n C o l l e g e \ B S c _ I T \ C \ BSc IT C Programming (2013-2017) Unit I Q1. What do you understand by type conversion? (2013) Q2. Why we need different data types? (2013) Q3 What is the output of the following (2013) main() Printf( %d,

More information

CERT C Rules implemented in the LDRA tool suite

CERT C Rules implemented in the LDRA tool suite CERT C Rules implemented in the LDRA tool suite This section lists a snapshot of the CERT C Coding Standard guidelines in 2014 that are automatically checked by version 9.5.1 of the LDRA tool suite. Guidelines

More information

Contents. 1 Introduction to Computers, the Internet and the World Wide Web 1. 2 Introduction to C Programming 26

Contents. 1 Introduction to Computers, the Internet and the World Wide Web 1. 2 Introduction to C Programming 26 Preface xix 1 Introduction to Computers, the Internet and the World Wide Web 1 1.1 Introduction 2 1.2 What Is a Computer? 4 1.3 Computer Organization 4 1.4 Evolution of Operating Systems 5 1.5 Personal,

More information

Contents. Figures. Tables. Examples. Foreword. Preface. 1 Basics of Java Programming 1. xix. xxi. xxiii. xxvii. xxix

Contents. Figures. Tables. Examples. Foreword. Preface. 1 Basics of Java Programming 1. xix. xxi. xxiii. xxvii. xxix PGJC4_JSE8_OCA.book Page ix Monday, June 20, 2016 2:31 PM Contents Figures Tables Examples Foreword Preface xix xxi xxiii xxvii xxix 1 Basics of Java Programming 1 1.1 Introduction 2 1.2 Classes 2 Declaring

More information

About Codefrux While the current trends around the world are based on the internet, mobile and its applications, we try to make the most out of it. As for us, we are a well established IT professionals

More information

Model Viva Questions for Programming in C lab

Model Viva Questions for Programming in C lab Model Viva Questions for Programming in C lab Common to: CSE 2 nd sem IT 2 nd sem Title of the Practical: Assignment to prepare general algorithms and flow chart. Q1: What is a flowchart? A1: A flowchart

More information

Presented By : Gaurav Juneja

Presented By : Gaurav Juneja Presented By : Gaurav Juneja 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 of UNIX are written

More information

UNIT- 3 Introduction to C++

UNIT- 3 Introduction to C++ UNIT- 3 Introduction to C++ C++ Character Sets: Letters A-Z, a-z Digits 0-9 Special Symbols Space + - * / ^ \ ( ) [ ] =!= . $, ; : %! &? _ # = @ White Spaces Blank spaces, horizontal tab, carriage

More information

COMP322 - Introduction to C++ Lecture 02 - Basics of C++

COMP322 - Introduction to C++ Lecture 02 - Basics of C++ COMP322 - Introduction to C++ Lecture 02 - Basics of C++ School of Computer Science 16 January 2012 C++ basics - Arithmetic operators Where possible, C++ will automatically convert among the basic types.

More information

Absolute C++ Walter Savitch

Absolute C++ Walter Savitch Absolute C++ sixth edition Walter Savitch Global edition This page intentionally left blank Absolute C++, Global Edition Cover Title Page Copyright Page Preface Acknowledgments Brief Contents Contents

More information

advanced data types (2) typedef. today advanced data types (3) enum. mon 23 sep 2002 defining your own types using typedef

advanced data types (2) typedef. today advanced data types (3) enum. mon 23 sep 2002 defining your own types using typedef today advanced data types (1) typedef. mon 23 sep 2002 homework #1 due today homework #2 out today quiz #1 next class 30-45 minutes long one page of notes topics: C advanced data types dynamic memory allocation

More information

Structures, Unions Alignment, Padding, Bit Fields Access, Initialization Compound Literals Opaque Structures Summary. Structures

Structures, Unions Alignment, Padding, Bit Fields Access, Initialization Compound Literals Opaque Structures Summary. Structures Structures Proseminar C Grundlagen und Konzepte Michael Kuhn Research Group Scientific Computing Department of Informatics Faculty of Mathematics, Informatics und Natural Sciences University of Hamburg

More information

KLiC C Programming. (KLiC Certificate in C Programming)

KLiC C Programming. (KLiC Certificate in C Programming) KLiC C Programming (KLiC Certificate in C Programming) Turbo C Skills: The C Character Set, Constants, Variables and Keywords, Types of C Constants, Types of C Variables, C Keywords, Receiving Input, Integer

More information

Welcome to Teach Yourself Acknowledgments Fundamental C++ Programming p. 2 An Introduction to C++ p. 4 A Brief History of C++ p.

Welcome to Teach Yourself Acknowledgments Fundamental C++ Programming p. 2 An Introduction to C++ p. 4 A Brief History of C++ p. Welcome to Teach Yourself p. viii Acknowledgments p. xv Fundamental C++ Programming p. 2 An Introduction to C++ p. 4 A Brief History of C++ p. 6 Standard C++: A Programming Language and a Library p. 8

More information

Fundamental of C programming. - Ompal Singh

Fundamental of C programming. - Ompal Singh Fundamental of C programming - Ompal Singh HISTORY OF C LANGUAGE IN 1960 ALGOL BY INTERNATIONAL COMMITTEE. IT WAS TOO GENERAL AND ABSTRUCT. IN 1963 CPL(COMBINED PROGRAMMING LANGUAGE) WAS DEVELOPED AT CAMBRIDGE

More information

Memory and C/C++ modules

Memory and C/C++ modules Memory and C/C++ modules From Reading #5 and mostly #6 More OOP topics (templates; libraries) as time permits later Program building l Have: source code human readable instructions l Need: machine language

More information

Computer Programming C++ (wg) CCOs

Computer Programming C++ (wg) CCOs Computer Programming C++ (wg) CCOs I. The student will analyze the different systems, and languages of the computer. (SM 1.4, 3.1, 3.4, 3.6) II. The student will write, compile, link and run a simple C++

More information

CMPE-013/L. Introduction to C Programming

CMPE-013/L. Introduction to C Programming CMPE-013/L Introduction to C Programming Bryant Wenborg Mairs Spring 2014 What we will cover in 13/L Embedded C on a microcontroller Specific issues with microcontrollers Peripheral usage Reading documentation

More information

C Language Part 1 Digital Computer Concept and Practice Copyright 2012 by Jaejin Lee

C Language Part 1 Digital Computer Concept and Practice Copyright 2012 by Jaejin Lee C Language Part 1 (Minor modifications by the instructor) References C for Python Programmers, by Carl Burch, 2011. http://www.toves.org/books/cpy/ The C Programming Language. 2nd ed., Kernighan, Brian,

More information

Programming Fundamentals (CS 302 ) Dr. Ihsan Ullah. Lecturer Department of Computer Science & IT University of Balochistan

Programming Fundamentals (CS 302 ) Dr. Ihsan Ullah. Lecturer Department of Computer Science & IT University of Balochistan Programming Fundamentals (CS 302 ) Dr. Ihsan Ullah Lecturer Department of Computer Science & IT University of Balochistan 1 Outline p Introduction p Program development p C language and beginning with

More information

Course Text. Course Description. Course Objectives. StraighterLine Introduction to Programming in C++

Course Text. Course Description. Course Objectives. StraighterLine Introduction to Programming in C++ Introduction to Programming in C++ Course Text Programming in C++, Zyante, Fall 2013 edition. Course book provided along with the course. Course Description This course introduces programming in C++ and

More information

Contents Lecture 3. C Preprocessor, Chapter 11 Declarations, Chapter 8. Jonas Skeppstedt Lecture / 44

Contents Lecture 3. C Preprocessor, Chapter 11 Declarations, Chapter 8. Jonas Skeppstedt Lecture / 44 Contents Lecture 3 C Preprocessor, Chapter 11 Declarations, Chapter 8 Jonas Skeppstedt (js@cs.lth.se) Lecture 3 2014 1 / 44 C Preprocessor Predefined macros Macro replacement Conditional inclusion Source

More information

QUIZ. 1. Explain the meaning of the angle brackets in the declaration of v below:

QUIZ. 1. Explain the meaning of the angle brackets in the declaration of v below: QUIZ 1. Explain the meaning of the angle brackets in the declaration of v below: This is a template, used for generic programming! QUIZ 2. Why is the vector class called a container? 3. Explain how the

More information

DHANALAKSHMI SRINIVASAN INSTITUTE OF RESEARCH AND TECHNOLOGY SIRUVACHUR, PERAMBALUR DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

DHANALAKSHMI SRINIVASAN INSTITUTE OF RESEARCH AND TECHNOLOGY SIRUVACHUR, PERAMBALUR DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING DHANALAKSHMI SRINIVASAN INSTITUTE OF RESEARCH AND TECHNOLOGY SIRUVACHUR, PERAMBALUR-621113 DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING GE6151 COMPUTER PROGRAMMING PART A (2 MARKS QUESTION WITH ANSWERS)

More information

Quiz Start Time: 09:34 PM Time Left 82 sec(s)

Quiz Start Time: 09:34 PM Time Left 82 sec(s) Quiz Start Time: 09:34 PM Time Left 82 sec(s) Question # 1 of 10 ( Start time: 09:34:54 PM ) Total Marks: 1 While developing a program; should we think about the user interface? //handouts main reusability

More information

CSC 1600 Memory Layout for Unix Processes"

CSC 1600 Memory Layout for Unix Processes CSC 16 Memory Layout for Unix Processes" 1 Lecture Goals" Behind the scenes of running a program" Code, executable, and process" Memory layout for UNIX processes, and relationship to C" : code and constant

More information

CS201 Latest Solved MCQs

CS201 Latest Solved MCQs Quiz Start Time: 09:34 PM Time Left 82 sec(s) Question # 1 of 10 ( Start time: 09:34:54 PM ) Total Marks: 1 While developing a program; should we think about the user interface? //handouts main reusability

More information