Professional Documents
Culture Documents
Programming Fundamentals
Covered ?
• Introduction to program, programming, source code, open source ,
languages , translators
• Types of languages
• Types of translators
• Data types
• Memory reservations and ranges
• Constants
• Variables
Constant?
• Fixed value/data
• Can not be changed at run time
• Single value in an identifier a=10;
• No more than once value acceptance
• If int then we can put only integer data= same / homogenous
• Can be declared within the main body or out of main
• Within main called (local) and out of main called global declaration
• The integer is type of data, ‘a’ is identifier and 10 is fixed value/data
• Used as a medium to store the data (work like a container) – whether data is
being stored temporarily or permanent.
Variable ?
• Single value but variable/ changeable, can be changed at run-time during
execution
• Can be global or local
• Local declaration is within the main
• Global declaration is out of main (above or below but not inside any other
function(user defined function).
• This is also a medium to store the data whether permanent or temporary.
• Permanent means in FILE and temporary means data is stored in primary
memory – will be flushed if the computer is turned OFF.
Homogenous: Int a[5] = {20,30,40,50,60};
Constant Variable Array Structure
Single value Single value Multi-values Heterogenous
Homogenous
Temp/perm Temp/perm Temporary/perm Temporary /
permanent
Medium/container Medium/container = =
Fixed Variable/changeabl = =
e
Same data types Same data types = Int, float, char
may be used may be used. Same DTMBU
Local/global Local / global = =
FILES ARE THE
SOLUTION TO THIS
PROBLEM
DECLARATION OF VARIABLE
• This can also be used in any user defined function which is described
out of main() body.
getch();
}
GLOBAL CAN BE USED
Int a;
void main()
{
program statements
a is used within the main (though it is declared globally but can be used in
main()
}
USER DEFINED FUNCTION
void user_defined()
{
a is again used here because it can be as it is declared globally.
}
BSCS : you can attend only classes of BSCS
BSCS-2021: you can attend only classes of BSCS OF 2021
BUT IF (NOT POSSIBLE BUT) A STUDENT IS ENROLLED FOR GENERAL
PURPOSE THEN HE/SHE CAN ATTEND ALL CLASSES GLOBALLY.
HE CAN GO ANYWEHRE
HE CAN BE EVALUATED IN ANY DEPARTMENT
HE CAN BE USED ANYWHERE