C Programming Language

Slides:



Advertisements
Similar presentations
Introduction to C++ An object-oriented language Unit - 01.
Advertisements

Compilation and Debugging 101. Compilation in C/C++ hello.c Preprocessor Compiler stdio.h tmpXQ.i (C code) hello.o (object file)
Pemrograman C Risanuri Hidayat. Why C  Compact, fast, and powerful  “Mid-level” Language  Standard for program development (wide acceptance)  It is.
Structure of a C program
C Programming Language 4 Developed in 1972 by Dennis Ritchie at AT&T Bell Laboratories 4 Used to rewrite the UNIX operating system 4 Widely used on UNIX.
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?
 2000 Deitel & Associates, Inc. All rights reserved. Chapter 17 - The Preprocessor Outline 17.1Introduction 17.2The #include Preprocessor Directive 17.3The.
The C Language 1/31/14.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 13 - The Preprocessor Outline 13.1Introduction.
 2000 Prentice Hall, Inc. All rights reserved. Chapter 13 - The Preprocessor Outline 13.1Introduction 13.2The #include Preprocessor Directive 13.3The.
Chapter 3: Introduction to C Programming Language C development environment A simple program example Characters and tokens Structure of a C program –comment.
C How to Program, 6/e © by Pearson Education, Inc. All Rights Reserved.
 2007 Pearson Education, Inc. All rights reserved C Preprocessor.
 2003 Prentice Hall, Inc. All rights reserved. 1 Chapter 19 - The Preprocessor Outline 19.1 Introduction 19.2 The #include Preprocessor Directive 19.3.
By: Mr. Baha Hanene Chapter 3. Learning Outcomes We will cover the learning outcome 02 in this chapter i.e. Use basic data-types and input / output in.
Windows Programming Lecture 05. Preprocessor Preprocessor Directives Preprocessor directives are instructions for compiler.
Chapter 3 Getting Started with C++
Introduction of C++ language. C++ Predecessors Early high level languages or programming languages were written to address a particular kind of computing.
Goals of Course Introduction to the programming language C Learn how to program Learn ‘good’ programming practices.
Macros. There are three basic phases for C programming. preprocessing, compiling, and linking. C input file is first passed to a preprocessing program.
C++ Basics Structure of a Program. C++ Source Code Plain text file Typical file extension .CPP Must compile the C++ source code without errors before.
The Structure of a C++ Program. Outline 1. Separate Compilation 2. The # Preprocessor 3. Declarations and Definitions 4. Organizing Decls & Defs into.
Introduction to C Programming CE Lecture 7 Compiler options and makefiles.
History of C 1950 – FORTRAN (Formula Translator) 1959 – COBOL (Common Business Oriented Language) 1971 – Pascal Between Ada.
/* Documentations */ Pre process / Linking statements Global declarations; main( ) { Local Declarations; Program statements / Executable statements; }
Sharda University P. K. Mishra (Asst.Prof) Department of Computer Science & Technology Subject Name: Programming Using C Sub Code: CSE-106 Programming.
COMPUTER PROGRAMMING. A Typical C++ Environment Phases of C++ Programs: 1- Edit 2- Preprocess 3- Compile 4- Link 5- Load 6- Execute Loader Primary Memory.
Structure of a C program Preprocessor directive (header file) Program statement } Preprocessor directive Global variable declaration Comments Local variable.
Fundamentals of C and C++ Programming. EEL 3801 – Lotzi Bölöni Sub-Topics  Basic Program Structure  Variables - Types and Declarations  Basic Program.
ADTs and C++ Classes Classes and Members Constructors The header file and the implementation file Classes and Parameters Operator Overloading.
C++ Basics C++ is a high-level, general purpose, object-oriented programming language.
Basic Program Construction
C How to Program, 7/e © by Pearson Education, Inc. All Rights Reserved.
JavaScript Syntax, how to use it in a HTML document
 2003 Prentice Hall, Inc. All rights reserved. 1 IS 0020 Program Design and Software Tools Preprocessing Lecture 12 April 7, 2005.
Chapter 2 part #1 C++ Program Structure
DOCUMENTATION SECTION GLOBAL DECLARATION SECTION
 2003 Prentice Hall, Inc. All rights reserved. 1 IS 0020 Program Design and Software Tools Preprocessor Midterm Review Lecture 7 Feb 17, 2004.
Functions  A Function is a self contained block of one or more statements or a sub program which is designed for a particular task is called functions.
Agenda Comments Identifiers Keywords Syntax and Symentics Indentation Variables Datatype Operator.
Lecture-3 Functions and Recursion. C Preprocessor Includes header files like stdio.h Expands macros defined Handles conditional compilations PreprocessorProcessor.
THE PREPROCESSOR
The Preprocessor Directives Introduction Preprocessing – Occurs before program compiled Inclusion of external files Definition of symbolic constants.
 2000 Prentice Hall, Inc. All rights reserved. Chapter 13 - The Preprocessor Outline 13.1Introduction 13.2The #include Preprocessor Directive 13.3The.
1 Object-Oriented Programming -- Using C++ Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology
FUNCTIONS. Midterm questions (1-10) review 1. Every line in a C program should end with a semicolon. 2. In C language lowercase letters are significant.
MAHENDRAN. Session Objectives Session Objectives  Discuss the Origin of C  Features of C  Characteristics of C  Current Uses of C  “C” Programming.
1 Structure of Simple C++ Program Chapter 1 09/09/13.
CHAPTER 3 COMPLETING THE PROBLEM- SOLVING PROCESS AND GETTING STARTED WITH C++ An Introduction to Programming with C++ Fifth Edition.
STRUCTURED PROGRAMMING Complete C++ Program. Content 2  Main Function  Preprocessor directives  User comments  Escape characters  cout statement.
13 C Preprocessor.
Topic Pre-processor cout To output a message.
C Programming Hardik H. Maheta.
Chapter 13 - The Preprocessor
History of ‘C’ Root of the morden language is ALGOL It’s first
C language IT-1 (Batch-A) Name: EnNo: Arshad Muthalif
' C ' PROGRAMMING SRM-MCA.
Welcome In The World Of ‘C’.  TEXT BOOK: Programming in ANSI ‘C By: E Balagurusamy. TMH  Reference Books: 1) The ‘C Programming Language By: Kernighan.
Visit for more Learning Resources
C Preprocessor(CPP).
The C Programming Language
Govt. Polytechnic,Dhangar
C++ Compilation Model C++ is a compiled language
What Is? function predefined, programmer-defined
Introduction to Programming - 1
C Programming Language
Course Outcomes of Programming In C (PIC) (17212, C203):
Conditional Compilation
Chapter 2 part #1 C++ Program Structure
Getting Started With Coding
Presentation transcript:

C Programming Language Basics www.btechsmartclass.com

Basics of C Programming? C is a structured programming language. So every instruction in a c program must follow the predefined structure (Syntax). C is also known as Function Oriented Programming Language. So every executable statement must written inside a function. 1

General Structure of a C Program /* Documentation */ Pre-Processing Statements Global Declarations Main method Used defined methods implementation 2

General Structure of a C Program Documentation - It is used to provide brief information of the program. - This part is written using comments. - Generally the documentation part does not executed by compiler & it is optional part. /* Documentation */ Pre-Processing Statements Global Declarations Main method Used defined methods implementation 3

General Structure of a C Program Pre-Processing Statements - It is used to link the header files, define the constants, etc... - Every preprocessor statement starts with hash (#) symbol. - Every Preprocessor statement tells to the compiler to perform required pre-processing before the actual compilation. /* Documentation */ Pre-Processing Statements Global Declarations Main method Used defined methods implementation 4

General Structure of a C Program Pre-Processing Statements - Examples #include #define #undef #ifdef #ifndef #if #else #elif #endif #error #pragma /* Documentation */ Pre-Processing Statements Global Declarations Main method Used defined methods implementation 5

General Structure of a C Program Global Declaration - This part is used to declare the variables which are common for multiple methods. - In this section, we also declare enumeration, structure, unions, userdefined methods etc... - It is also optional part. According to our requirement we write this section. /* Documentation */ Pre-Processing Statements Global Declarations Main method Used defined methods implementation 6

General Structure of a C Program Main method - main method is the compulsory part for any c program. - C language is a function oriented programming language, so every c program must have at least one function and that must be main. - Main is a userdefined method which specifies the starting point of the program execution. - Every c program execution starts with main method and ends with main method itself. /* Documentation */ Pre-Processing Statements Global Declarations Main method Used defined methods implementation 7

General Structure of a C Program Userdefined Methods - In this section of the program we write the actual code for the userdefined methods. - Userdefined methods can be implemented either before or after the method. - If it is implemented after the main then it must be declared either inside or before the main method. - If it is implemented before the main then the declaration can be ignored. /* Documentation */ Pre-Processing Statements Global Declarations Main method Used defined methods implementation 8

General Structure of a C Program - Example /* Program to print a message Hello World! */ #include<stdio.h> void main() { printf(“Hello World!!!!”); } 9

Rules for Writing C programs Every c program must contain exact one main method Every executable instruction must end with semicolon (;) All the system defined words (Keywords) must be used in lowercase letters Every open brace ({) must have the respective closing brace (}) The variables must be declared in the declaration section before they are used 10

For more information please visit www.btechsmartclass.com Please do subscribe my channel