Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 27

C.

Programming
01
Mid-term

Class name : C. Programming


Lecturer : Reduanul Bari Shovon
Variable 02

• Variable: A variable is
nothing but a name given
to a storage area that our
programs can manipulate.
Each variable in C has a
specific type, which
determines the size and
layout of the variable's
memory; the range of
values that can be stored
within that memory; and
the set of operations that
can be applied to the
variable.
Type of 03
Variable:

Variable

Numeric Categorical

Continuous Discrete Ordinal Non-ordinal


Syntax of 04
Declaring:
• Syntax of Declaring: The word
syntax means the grammar of a
programming language. We can
talk about the syntax of just a small
part of a program, such as the
syntax of variable declaration.
• There are several ways to declare
variables: Data Type variable
Name; This declares a variable,
declares its data type, and reserves
memory for it.
Main 05
function:
• Main function: A main
is a predefined
keyword or function in
C. It is the first function
of every C program that
is responsible for
starting the execution
and termination of the
program. It is a special
function that always
starts executing code
from the 'main' having
'int' or 'void' as return
data type.
Header File: 06

• Header File: A header file


is a file with extension . h
which contains C function
declarations and macro
definitions to be shared
between several source
files. There are two types
of header files: the files
that the programmer
writes and the files that
comes with your compiler.
Printf(): 07

• Printf(): The printf()


is a library function to
send formatted output
to the screen. The
function prints the
string inside quotations.
To use printf() in our
program, we need to
include stdio. h header
file using the #include
<stdio. h> statement.
Scanf(): 08

• Scanf(): In the C programming


language, scanf is a function
that reads formatted data from
stdin (i.e, the standard input
stream, which is usually the
keyboard, unless redirected)
and then writes the results into
the arguments given.
• This function belongs to a family
of functions that have the same
functionality but differ only in
their source of data. For
example, fscanf gets its input
from a file stream, whereas
sscanf gets its input from a
string.
Integer: 09

• Integer: Integers
are whole numbers
that can have both
zero, positive and
negative values but no
decimal values. For
example, 0 , -5 , 10. We
can use int for
declaring an integer
variable. int id; Here,
id is a variable of type
integer.
Float: 10

• Float: Float is a
shortened term for
"floating point." By
definition, it's a
fundamental data type
built into the compiler
that's used to define
numeric values with
floating decimal
points. C, C++, C# and
many other
programming languages
recognize float as a
data type. Other
common data types
Double: 11

• Double: A double is a
data type in C
language that stores
high-precision floating-
point data or numbers
in computer memory.
It is called double data
type because it can
hold the double size of
data compared to the
float data type. A
double has 8 bytes,
which is equal to 64 bits
in size.
Return: 12

• Return: A return
statement ends the
execution of a function,
and returns control to
the calling function.
Execution resumes in
the calling function at
the point immediately
following the call. A
return statement can
return a value to the
calling function.
Semicolon(;): 13

• Semicolon(;):
Semicolons are end
statements in C. The
Semicolon tells that the
current statement has
been terminated and
other statements
following are new
statements.
For Practice:01 14
For Practice:02 15
For Practice:03 16
For Practice:04 17
For Practice:05 18
For Practice:06 19
For Practice:07 20
For Practice:08 21
For Practice:09 22
For Practice:10 23
For Practice:11 24
For Practice:12 25
For Practice:13 26
For Practice:14 27

You might also like