What is a Variable ?
Memory is in form of blocks
128
254
512 556
1024 1248
1455 2048
206
Memory is in form of blocks
Suppose, we need to
store 10 in the memory 10
Stored in any
random location
Note-: We cannot access this value
10 in future because we don’t have
any location for this
a
Stored in this
location
a=10
printf(a)
Syntax-: data_type variable_name;
So, We Need Variables
Example-: int a;
Rules for defining a variable or identifier in C
• Variable must begin with a letter or an underscore.
• Variable can contain digits but not start with a digit.
• No special character is allowed to use other that underscore.
• Keywords cannot be used as a variable name.
What is in C library ?
Library is a collection of header files
stdio.h conio.h string.h
graphics.h math.h dos.h
Library
Header
Files
printf()
scanf()
clrscr()
getch()
strlen()
strrev()
setcolor()
setbkcolor()
rand()
pow()
getdate()
gettime()
Header files is the collection of related predefined
functions and C library is collection of header files

What is Variables and Header files

  • 1.
    What is aVariable ?
  • 2.
    Memory is inform of blocks 128 254 512 556 1024 1248 1455 2048 206
  • 3.
    Memory is inform of blocks Suppose, we need to store 10 in the memory 10 Stored in any random location Note-: We cannot access this value 10 in future because we don’t have any location for this
  • 4.
    a Stored in this location a=10 printf(a) Syntax-:data_type variable_name; So, We Need Variables Example-: int a;
  • 5.
    Rules for defininga variable or identifier in C • Variable must begin with a letter or an underscore. • Variable can contain digits but not start with a digit. • No special character is allowed to use other that underscore. • Keywords cannot be used as a variable name.
  • 6.
    What is inC library ? Library is a collection of header files stdio.h conio.h string.h graphics.h math.h dos.h Library Header Files printf() scanf() clrscr() getch() strlen() strrev() setcolor() setbkcolor() rand() pow() getdate() gettime()
  • 7.
    Header files isthe collection of related predefined functions and C library is collection of header files