Computer Programming IBA - 3
Computer Programming IBA - 3
PROGRAMMING
3. Decision Making
4. Repetition Structures
5. C Input Functions
6. C Operators
Predecessors of C
In the early 1970s, Dennis Ritchie and his colleagues at Bell Labs sought to
overcome the limitations of the B language. In 1972, Ritchie developed C as an
improvement over B, adding data types and other features to support more complex
programming tasks.
UNIX Operating System: C was initially designed to rewrite the UNIX operating
system, which had been originally developed in assembly language. This transition
made UNIX more portable and easier to maintain, as C allowed for more abstract
coding.
Reasons to Use C
01 Industry Presence
04 Flexibility
06 Speed
● C is known for its high performance and efficiency due to low-level access to
memory and system resources.
● Ideal for performance-critical applications, such as operating systems, game
engines, and real-time systems.
Advantages of C
Pseudocode
is an artificial and informal language that helps programmers develop algorithms.
Pseudocode is very similar to everyday English.
Example 1: Write an algorithm to determine a student's final grade and indicate
whether it is passing or failing. The final grade is calculated as the average of four
marks.
Pseudocode::
otherwise
End process
Flowcharts
Step4: STOP
1. Writing and editing the program using Text editor (source code).
1: Identifiers
2: Keywords
3: Constants
4: Strings
5: Special Symbols
6: Operators
Identifiers
Identifiers refer to the names of variables, constants, functions and arrays. These are
user-defined names is called Identifiers. These identifier are defined against a set of
rules.
1. An Identifier can only have alphanumeric characters( a-z , A-Z , 0-9 ) and underscore(
_).
2. The first character of an identifier can only contain alphabet( a-z , A-Z ) or
underscore ( _).
3. Identifiers are also case sensitive in C. For example name and Name are two
different identifier in C.
To store data the program must reserve space which is done using datatype. A
datatype is a keyword/predefined instruction used for allocating memory for data.
Basic Data Types
Variables
A variable is a name of memory location. It is used to store data. Variables are
changeable, we can change value of a variable during execution of a program.
It can be reused many times.
A variable can be used to store a value of any data type. The declaration of variables
must be done before they are used in the program. The general format for declaring
a variable.
Ex : int x,y,z;
float a,b;
char m,n;
Assigning values to variables : values can be assigned to variables using the
assignment operator (=). The general format statement is :
Ex : int x=100;
Lorem ipsum dolor sit amet, Ut enim ad minim veniam, quis Excepteur sint occaecat
consectetur adipiscing elit, nostrud exercitation cupidatat non proident, sunt
sed do eiusmod tempor in culpa qui officia deserunt
incididunt ut labore et dolore ● Duis aute irure dolor in mollit anim id est laborum.
magna aliqua. reprehenderit in
voluptate velit
Ut enim ad minim veniam, quis
● Esse cillum dolore eu
nostrud exercitation
fugiat nulla pariatur
Thank You !!