In this presentation, we'll cover the basics of C programming, including its structure, fundamental data types (int, float, char), conditional statements (if, else), and loops (for, while). We'll also touch on pointers and structures, offering a concise overview to build a solid foundation in C programming.
2. C PROGRAM
Header Files
These are precompiled files that
have some functions defined in
them.
Entry Point
When a file is executed the entry
point in main function.
BASIC STRUCTURE OF
Delimiters
The braces after the function
definition signal the beginning and
end of the body of the function.
3. DATA TYPES
Integers
A whole number that is number not
having any fractional components
Float
An integer with floating point
Character
A single character.
Data Type
Keyword
Variable Name (Identifier)
Assignment
Arrays
Can contain a collection of similar
data type.
4. SIMPLE PROGRAM
• ‘&’ is used to target address of variable.
• ‘scanf’ is a function used for input.
• ‘printf’ is used for output.
• ‘%s’ is a format specifier.
5. CONDITIONAL STATEMENTS
• ‘==’ is a operator .
• ‘&&’, ‘||’, ‘!’ are logical operators.
• ‘!=’, ‘==’, ‘<’, ‘>’, ‘<=’, ‘>=’ are relational operators.
• The first statement will be executed if a is equal to 0.
• If a is equal to 1 then the second condition will be
executed.
• Otherwise, the last condition will be executed.
6. CONDITIONAL STATEMENTS
• The same conditions can be implemented using
a switch case.
• Switch-case conditions can’t have logical or
relational operators.
9. DO WHILE LOOP
• Do-While loops always get executed once
and then check the condition.
10. FUNCTIONS
• Prototyping
<<Return Type>> funName(params);
• Definition
<<returnType>> funName(params){}
• Function Call
funName(params);
• If the function does not return anything
then void is used.