Programming Flashcards
Whats a computer program
A computer program is a sequence or set of instructions in a
programming language for a computer to execute.
Whats Low level language
● In machine level language, computer only understand digital numbers
i.e. in the form of 0 and 1.
● So, instruction given to the computer is in the form binary digit, which
is difficult to implement instruction in binary code.
● This type of program is not portable.
Whats Low level language
● In machine level language, computer only understand digital numbers
i.e. in the form of 0 and 1.
● So, instruction given to the computer is in the form binary digit, which
is difficult to implement instruction in binary code.
● This type of program is not portable.
Whats Middle level language
● The assembly language is on other hand modified version of machine
level language.
● Here instructions are given in English like word as ADD, SUM, MOV
etc.
● It is easy to write and understand but not understand by the machine. So
the translator used here is assembler to translate into machine level.
● This language is bit easier.
In the assembly level language the data are stored in the computer
register, which varies for different computer. Hence it is not portable.
Whats High level language
High Level Language
● It can be considered as a programmer-friendly language.
● It is easy to understand.
● It is easy to debug.
● It is simple in terms of maintenance.
C, C++, Java, Python
Whats IDE
Integrated Development Environments (IDE)
● The process of editing, compiling, running, and debugging programs is
often managed by a single integrated application known as IDE.
● On Mac OS, CodeWarrior and Xcode are two IDEs.
Whats IDE
Integrated Development Environments (IDE)
● The process of editing, compiling, running, and debugging programs is
often managed by a single integrated application known as IDE.
● On Mac OS, CodeWarrior and Xcode are two IDEs.
Features of C program are
(Simple,Fast,Machine independant,mid-level language)
Features of C Programming Language
● Simple: The basic syntax style of implementing C language is very simple
and easy to learn.
● Fast: The compilation and execution time of C language is fast since there
are lesser inbuilt functions and hence the lesser overhead.
● Machine Independent or Portable: Unlike assembly language, c programs
can be executed on different machines with some machine specific changes.
● Mid-level Programming Language: C is intended to do low-level programming. It is used to develop system applications such as kernel,driver, etc. It also supports the features of a high-level language.
Features of C Programming Language
(Structured Programming Language, Function Rich Library, Dynamic Memory Management)
● Structured Programming Language: C is a structured programming language in the sense that we can break the Program into parts using functions. So, it is easy to understand and modify. Functions also provide code reusability.
● Function Rich Library: C provides a lot of inbuilt functions that make the development fast.
● Dynamic Memory Management: It means that you can utilize and manage
the size of the data structure in C during runtime. C also provides several predefined functions (malloc(), calloc(), and realloc() ) to work with memory
allocation.
Features of C Programming Language
(Pointers,Easy to extend, Case senstivity)
● Pointers: With the use of pointers in C, you can directly interact with
memory. Using the C pointers, you can operate with memory, arrays,
functions, and structures.
● Easy to Extend: Programs written in C language can be extended means
when a program is already written in it then some more features and
operations can be added to it.
● Case sensitivity: It means both upper and lower case characters are treated
differently. Case sensitivity in C language helps to compile the C programs
faster.
Structure of C Language Program is?
- Documentation section
- Preprocessor section
- Definition section
- Global declaration
- Main function
- User defined functions
Whats Documentation section?
Documentation section
● It includes the statement specified at the beginning of a program, such as
a program’s name, date, description, and title.
● It is represented as:
//name of a program
/*
name of a program
*/
● Whatever is written between these two are called comments.
Whats Preprocessor section?
Preprocessor section
● It contains all the header files used in a program.
● It informs the system to link the header files to the system libraries.
● It is given by:
a. #include<stdio.h>
b. #include<conio.h>
● Header files help us to access other’s improved code into our code.
● A copy of these multiple files is inserted into our program before the
process of compilation.
● Semicolon is not used.</conio.h></stdio.h>
What is Definition section!?
● The define section comprises of different constants declared using the
define keyword.
● Semicolon is not used.
● It is given by:
○ #define a 2
?!Whats Global Declaration section
Global Declaration section
● The global declaration section contains global variables, function
declaration, and static variables.
● Variables and functions which are declared in this scope can be used
anywhere in the program.
● It is given by:
○ int num = 18;
Whats Main function?
Main Function
● Every C program must have a main function.
● main() is the first function to be executed by the computer.
● It is like any other function available in the C library.
● Parenthesis () are used for passing parameters (if any) to a function.
● We can also use int or main with the main ().
● The void main() specifies that the program will not return any value.
● The int main() specifies that the program can return integer type data.
Whats Main function?
Main Function
● Every C program must have a main function.
● main() is the first function to be executed by the computer.
● It is like any other function available in the C library.
● Parenthesis () are used for passing parameters (if any) to a function.
● We can also use int or main with the main ().
● The void main() specifies that the program will not return any value.
● The int main() specifies that the program can return integer type data.