0% found this document useful (0 votes)
6 views16 pages

FPL Unit1 Notes

This document provides a comprehensive overview of program design tools and the fundamentals of C programming, including algorithms, flowcharts, and key concepts such as data types and variables. It covers the history and importance of C, its features, and the character sets used in programming. Additionally, it discusses the structure and advantages of flowcharts, as well as the role of tokens, keywords, and identifiers in C programming.

Uploaded by

kamblesadshiv032
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views16 pages

FPL Unit1 Notes

This document provides a comprehensive overview of program design tools and the fundamentals of C programming, including algorithms, flowcharts, and key concepts such as data types and variables. It covers the history and importance of C, its features, and the character sets used in programming. Additionally, it discusses the structure and advantages of flowcharts, as well as the role of tokens, keywords, and identifiers in C programming.

Uploaded by

kamblesadshiv032
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

  

Program Design Tools & C Programming


The Art of Programming through Algorithms, Flowcharts, and C Fundamentals

A comprehensive overview of program design methodology and the C programming language fundamentals
including history, character sets, tokens, data types, variables, constants, and storage classes.

Computer Science Department


Academic Year 2025-2026
Made with Genspark
Table of Contents
Program Design Tools C Programming

1. Introduction to Program Design Tools 7. History of C Programming

2. What is an Algorithm? 8. Importance & Features of C

3. Flowcharts: Purpose and Use 9. Character Set in C

4. Key Flowchart Symbols 10. Tokens in C

5. Example Program Flowcharts 11. Keywords & Identifiers

6. Advantages & Disadvantages of Flowcharts 12. Constants and Variables

13. Data Types in C

14. Storage Classes in C

15. Summary & Key Takeaways

 Learn the fundamentals of programming and C language 

Made with Genspark


Introduction to Program Design Tools
Program design tools help developers plan and visualize software
solutions before coding begins. They're essential for: The Program Design Process

 Problem Analysis: Breaking down complex problems into manageable


steps  
Problem  Algorithm
 Logic Design: Creating structured logic flow independent of programming
Understanding Design
language

 Communication: Facilitating clear understanding among team members 

 Documentation: Creating reference materials for future maintenance


 
Main Program Design Tools: Implementation  Flowchart
(Coding) Creation
Algorithms: Step-by-step procedures for solving problems
Flowcharts: Visual representations of algorithms using standardized
symbols Proper program design reduces development time and improves code quality

Pseudocode: Informal high-level descriptions of program logic

Made with Genspark


What is an Algorithm?
An algorithm is a finite sequence of well-defined, computer-
Factorial Algorithm Example
implementable instructions to solve a specific problem or perform a
computation.
1. Start
 Finite: Algorithm must terminate after a finite number of steps

 Definite: Each step must be precisely defined and unambiguous 2. Input number n

 Input: Algorithm takes zero or more inputs


3. Initialize fact = 1
 Output: Algorithm produces at least one output
4. For i = 1 to n
 Independent: Works regardless of programming language
fact = fact × i
Common Examples:
Searching algorithms (Binary search, Linear search) 5. Output fact
Sorting algorithms (Bubble sort, Merge sort, Quick sort)
Mathematical calculations (Greatest Common Divisor)
6. End
Graph algorithms (Shortest path, Minimum spanning tree)

Example execution for n = 4:


fact = 1
i = 1: fact = 1 × 1 = 1
i = 2: fact = 1 × 2 = 2
i = 3: fact = 2 × 3 = 6
i = 4: fact = 6 × 4 = 24
Output: 24

Made with Genspark


Flowcharts: Purpose and Use
A flowchart is a diagrammatic representation of an algorithm or
Basic Flowchart Structure
process using standardized symbols connected by arrows that show
the sequence of steps.
Start

 Visualization: Translates complex logic into an easy-to-understand visual 


format
Input Numbers
 Communication: Provides a universal language for sharing ideas across
teams 

 Problem Analysis: Helps identify logical errors and inefficiencies before Calculate Sum

coding

 Documentation: Serves as valuable program documentation for
maintenance and updates

Sum > 10? 


Key Applications in Programming:
No
Algorithm Design: Planning logical steps before writing code
Program Debugging: Identifying and resolving logical errors 
Yes
Process Optimization: Improving efficiency of existing processes
"Flowcharts make complex processes simple to understand at a glance"

Made with Genspark


Key Flowchart Symbols
Flowcharts use standardized symbols to represent different steps and
Common Flowchart Symbols
actions in a process. Understanding these symbols is essential for
reading and creating flowcharts.
Process
Terminal/Terminator
Computation or processing
 Universal Communication: Standard symbols ensure consistent Start or end of the process
step
interpretation across different teams and disciplines

 Clarity of Process: Each symbol's distinct shape visually indicates its


Decision Input/Output
function in the workflow Branching based on Data input or output
conditions operation
 Logical Structure: Symbols guide the reader through the sequence of
operations and decision points

Connector Flow Lines


Types of Flowcharts: Connection between parts Direction of process flow

Process Flowcharts (sequence of operations)


These standard symbols provide a universal language for algorithm representation
Decision Flowcharts (branching logic)
Data Flowcharts (data movement through systems)
System Flowcharts (hardware and software interactions)

Made with Genspark


Example Program Flowcharts
Flowcharts translate algorithms into visual representations that make
Common Flowchart Examples
logic easier to follow and understand.
1. Adding Two Numbers
 Purpose: These examples demonstrate how common programming
problems can be visually represented before coding Start

 Clarity: Flowcharts make logical flow and decision points immediately 


visible
Input num1, num2
 Complexity Management: Even complex algorithms become easier to

understand when visualized
sum = num1 +
Benefits for Programming: num2

Makes logical errors visible before coding begins 


Provides a language-independent blueprint for implementation Display sum
Serves as documentation for the program's logic

Facilitates communication with non-technical stakeholders
End

2. Finding Largest Among Three Numbers

Start

Input a, b, c

a>b?

True False
 
a>c? b>c?

Simplified representation (full flowchart would include


additional decision paths and output display)

3. Fibonacci Series Generation

Start

Initialize a=0, b=1

Display a, b

For i=2 to n

c=a+b

Display c

a = b, b = c

End

Made with Genspark


Advantages & Disadvantages of Flowcharts

Advantages  Disadvantages 

 Improved Communication  Complex for Large Programs


Visually represents logic in a way that's easy for both technical Becomes unwieldy and difficult to manage for large, complex
and non-technical stakeholders to understand programs

 Effective Analysis & Design  Time-Consuming to Create


Helps identify logical errors, redundancies, and inefficiencies Creating and updating detailed flowcharts can be labor-intensive
before coding begins
 Difficult to Modify
 Documentation Changes in program logic often require complete redrawing of
Serves as excellent program documentation for future flowcharts
maintenance and updates
 Lack of Standardization
 Debugging Aid No precise standard for the level of detail to include in a
Makes it easier to trace program flow and identify bugs in the flowchart
logic
 Can Become Obsolete
 Language Independence May not be updated when code changes, resulting in outdated
Represents logic without being tied to any specific programming documentation
language

Made with Genspark


History of C Programming
C is one of the most influential programming languages, developed in
C Language Evolution Timeline
the early 1970s at Bell Labs by Dennis Ritchie.

 Origins: Evolved from the B language (developed by Ken Thompson) and


BCPL language

 Purpose: Initially developed to implement the Unix operating system


Dennis Ritchie (1941-2011)
 Standardization: First formalized in "The C Programming Language" by
Kernighan & Ritchie (K&R C, 1978) 1969-1973:
C development at Bell Labs by Dennis Ritchie
 Influence: Has influenced many modern languages including C++, Java,
JavaScript, C#, and Python

 Legacy: Still widely used for system programming, embedded systems, and 1978:
applications requiring high performance K&R C - First book on C published ("The C Programming Language")

1989/1990:
ANSI C / C89/C90 - First standardized version

1999:
C99 - Added new features including inline functions and variable-length
arrays

2011/2018:
C11 and C17/C18 - Modern standards with multi-threading support

Made with Genspark


Importance & Features of C
Despite being over 50 years old, C programming language remains
Key Features of C Language
fundamentally important in modern computing due to:

 Hardware Proximity: Close relationship with hardware architecture, Procedural Language


Follows top-down approach with functions as basic units of programming
making it ideal for system programming

 Performance: Exceptional speed and memory efficiency for resource- Low-Level Memory Access
intensive applications Direct manipulation of memory using pointers and addresses

 Portability: Programs can be compiled on different platforms with minimal


changes Rich Set of Operators
Comprehensive collection of operators for various operations
 Foundation for Other Languages: Influenced popular languages
including C++, Java, JavaScript, and Python Structured Programming
Supports block structures, functions, and structured control statements
 OS Development: Core language for developing operating systems (Unix,
Linux, Windows kernels)
Modularity
Programs can be divided into modules for easier maintenance

"C is a language that combines the elements of high-level languages with the functionalism
of assembly language."
— Dennis Ritchie, creator of C

Made with Genspark


Character Set in C
A character set is a collection of valid characters that can be used in a
C Character Set Categories
C program. The C language supports the following character groups:

Alphabets Digits
 Alphabets: Both uppercase (A-Z) and lowercase (a-z) letters are allowed in
variable names, strings, and other identifiers A-Z a-z 0-9

 Digits: Numerical characters (0-9) used for constants, variable names Used for identifiers, variable names, Used for numeric constants and values
function names
(except as first character), and array indices

 Special Characters: Punctuation marks, brackets, operators, and other


Special Characters White Space
symbols used for program structure and operations
+-*/ =<>! (){} [],; Space Tab Newline
 White Space: Spaces, newlines, tabs, and other invisible characters used
to format code for readability #$&| ^%~_ "'\? Carriage Return Form Feed

Used for operators, punctuation, and Used for code formatting and readability
Note:
structure
The ASCII character set is a subset of the C character set, with values from 0 to
127.
Example Usage in Code

int main() {
// Alphabets & digits in identifiers
int counter123 = 0;
// Special chars for operations
counter123 = (counter123 + 5) * 2;
return 0;
}

Made with Genspark


Tokens in C
Tokens are the smallest individual units in a C program that are
Types of Tokens in C
meaningful to the compiler. The C compiler breaks a program into the
smallest possible units and proceeds to the various stages of
 Keywords
compilation. Reserved words with predefined meanings
Examples: int , float , if , else , while
 Definition: Fundamental building blocks recognized by the compiler

 Role: Form meaningful expressions and statements in C programs  Identifiers


Names given to variables, functions, arrays, etc.
 Syntax Rules: Each token must follow C language syntax rules Examples: main , count , sum , temp

Example C Program with Tokens: # Constants


Fixed values that cannot be modified
int main() { Examples: 10 , 3.14 , 'A' , 0xFF
int x = 10;
return 0;
}
 Strings
Sequence of characters enclosed in double quotes
This simple program contains tokens like: keywords ( int , return ), identifiers Example: "Hello World"

( main , x ), constants ( 10 , 0 ), and punctuators ( () , {} , ; ).


 Operators
Symbols that perform operations on operands
Examples: + , - , * , / , == , !=

Punctuators
Special symbols with syntactic meaning
Examples: {} , () , ; , , , []

Made with Genspark


Keywords & Identifiers

Keywords  Identifiers 

 Definition  Definition
Reserved words with predefined meanings in C language that Names given by programmers to variables, functions, arrays,
cannot be used as identifiers and other user-defined items

 Examples  Examples
int , char , float , if , else , while , for , return age , studentName , calculate_sum , _count ,
MAX_VALUE
 Characteristics
All keywords must be written in lowercase  Naming Rules
ANSI C has 32 keywords, C99 added more Must start with a letter or underscore
Cannot be redefined in a program Can contain letters, digits, and underscores
Case sensitive (count ≠ Count)
 Uses
Define data types (int, char, float)  Best Practices
Control program flow (if, else, switch) Use descriptive names that convey purpose
Create loops (for, while, do) Follow consistent naming conventions
Avoid names that are too similar
 Restrictions
Cannot be used as variable, function, or any identifier names  Practical Limits
Fixed set defined by the C standard No official limit on length, but most compilers recognize only the
first 31 characters
Cannot use C keywords as identifiers

Made with Genspark


Constants, Variables, and Data Types
C programming uses these fundamental elements for data storage and
Data Types in C
manipulation:

Integer Types
 Variables: Named storage locations that can be modified during program
execution int (4 bytes) short int (2 bytes)
-2,147,483,648 to 2,147,483,647 -32,768 to 32,767
int age = 25; // Value can change
long int (4-8 bytes) unsigned int (4 bytes)
 Constants: Fixed values that cannot be modified Platform-dependent range 0 to 4,294,967,295

const float PI = 3.14159;


Floating-Point Types
#define MAX_SIZE 100 // Preprocessor directive
float (4 bytes) double (8 bytes)
 Literals: Fixed values used directly in code ~1.2E-38 to 3.4E+38 ~1.7E-308 to 1.7E+308

int x = 10; // 10 is an integer literal


Character Types
char ch = 'A'; // 'A' is a character literal
char (1 byte)
Key Concepts: -128 to 127 or 0 to 255

Variables must be declared before use


Other Types
C is a strongly typed language
void _Bool (C99)
Each variable has a specific type that cannot be changed Represents absence of type 0 (false) or 1 (true)

Type determines the range of values a variable can hold


 Type sizes may vary between platforms and compilers

Made with Genspark


Storage Classes in C
Storage classes in C define the scope, lifetime, and visibility of
Storage Class Properties
variables. They determine where variables are stored, how long they
exist, and which parts of a program can access them.
Storage Class Scope Lifetime Default Value Memory

 auto: Default storage class for local variables. Variables are automatically auto Local Function/Block Garbage Stack
created and destroyed within their scope.
register Local Function/Block Garbage Register/Stack
 register: Suggests to store variables in CPU registers for faster access.
The compiler may ignore this suggestion based on available registers. static Local Program lifetime Zero Data segment

 static: Preserves variable values between function calls. Static variables extern Global Program lifetime Zero Data segment
are initialized only once and retain their value throughout program
execution.
 
 extern: Declares variables that are defined in other files or elsewhere in the File 1: main.c File 2: helper.c
program. Used for global variables shared across multiple files. 
extern int global; int global = 100;
void main() { ... } static int local = 50;
Code Example:
void demoFunction() {
The extern keyword allows variables to be shared across multiple files
auto int a = 10; // Local variable
static int count = 0; // Static - retains value
register int fast = 5; // Register - for faster access

count++;
printf("%d %d %d\n", a, count, fast);
}
Made with Genspark
Summary & Key Takeaways
Program Design Tools  C Programming 

 Algorithms  History & Importance


Step-by-step procedures for solving problems, independent of programming Developed by Dennis Ritchie (1970s), foundation for UNIX OS, influenced many
languages modern languages

 Flowcharts  Character Set & Tokens


Visual representations of algorithms using standardized symbols Letters, digits, special symbols form tokens (keywords, identifiers, constants,
operators)
 Flowchart Symbols
Process, decision, I/O, terminal, connector symbols communicate program flow  Variables & Constants
Variables store changeable values; constants (const, #define) store fixed values
 Advantages
Improved communication, effective analysis, better documentation, debugging aid  Data Types
int, float, char, double each with specific size and range to store different types of
 Limitations data
Complex for large programs, time-consuming to create, difficult to modify
 Storage Classes
auto, register, static, extern determine variable scope, lifetime, and visibility

Key Insight
Strong foundation in program design tools and C fundamentals is essential for developing efficient, well-structured software solutions

Made with Genspark

You might also like