Expressions, Header files, Include Header files and Input and Output Operations
Expressions:
When operands and operators are combined with each other then they form an expression. An expression is the combination of different type of operators and operands. For Example:- x + y + z
- x * y / 2 + 6 - 1
- 4 + 5 / 2 - 6 * 4
- ( 4 + 5 ) / 2 + 1 + ( 6 - 1 )
- C = x + y + z
In expression operators have their own priority. In an expression Brace has the first priority, so that part of an expression is first solved which are enclosed in the braces. The second priority is the Division or the Multiplication operators. These two operators have the same priority but the first coming will be solved first in an expression. The third and the last priority is the + and - operators. These two operators also have the same priority but the first coming operator will be solved first in an expression.
Header File:
Every programming language contains thousands of built-in functions. A function is a tool that is designed to perform a specific task. The functions are categorized into different files according to their similar nature and properties. For Example: string functions, input / output functions, math functions, graphic function, memory allocation and deallocation functions, container classes functions, disk input and output functions, data conversion function etc. These files are called header files. The functions in each header file have same nature and properties. The header files permanently stored in the built-in library of programming languages. In Turbo C++ each header file is stored with .h extension while in ANSI standard of C++ they are stored without the .h extension. When a programmer uses any built-in function in the program then he/she must include the header file of that function at the top of the program or before the using of that function.
Include Header Files:
To include header files in the program a keyword include is used with the # hash operator. The hash # operator is used before the keyword include. The header file that is to be included is enclosed within < > operators or enclosed within double quotes. Following are general syntaxes to include header files in the program:
#include < Header file name > or #include" Header file name "
The keyword include is called preprocessor directive. This directive will be covered in detail later.
Input and Output Operations:
When we give some instructions ( data ) to computer system then it is called an input and when computer responds to us and gives some messages or information then it is called an output. The input operation is perform through input devices i.e. keyboard, mouse etc. while the output operation is perform through the output devices i.e. monitor, printer etc. So to control such operations every programming language provide a set of built-in Input/Output (I/O) functions. The built-in I/O functions work as streams and provide an interface between the user and Input/Output devices.
Me : If you need more help, want to ask feel free to use below comment box. It will be my pleasure to help you. THANKS for reading.
0 comments:
Post a Comment