Wednesday, 2 March 2016

Precedence & Associativity - CPU Material



Define the terms precedence and associativity.
Answer:
When more than one operator is used in an expression, C language has predefined rules of to evaluate expression based on priority of operators. This rule of priority operators is known as precedence of operators.
In arithmetic operators,
Operator
Priority
Associativity
*, /, %
First
Left to Right
+, -
Second
Left to Right

Associativity:
If operators have same priority in one expression then rules define which operator is executed first in which order. This rule is known as associativity.
For example:
If expression contains * and / operators then both have same priority, so associativity rules will be applied for evaluating expression.
Ex:
D = A + B – C.
In this + and – both have same priority
Consider following table for both priority (precedence) and associativity. In this table top most operator has highest priority.
           
Operator
Meaning
Associativity
( ), ++, - -
Parenthesis, postfix increment, postfix decrement
Left to right
++, - -, sizeof
Prefix increment, prefix decrement, sizeof operator
Right to left
*, /, %
Multiplication, division, modulus
Left to right
+, -
Addition, subtraction
Left to right

Monday, 29 February 2016

CPU - Material



What is Tri – Graph?
Answer:
·        Some characters are not available in some keyboard.
·        So, for these characters ANSI C introduced the new concept of tri graph.
·        Tri graph provides a way to enter characters that are not available on some keyboard.
·        Tri graph consists of three characters. (First two question mark and last some other character)
Tri graph characters                            Translation
??=                                                   #
??(                                          [
??)                                                    ]
??<                                                   {
??>                                                   }
??/                                                  \
??-                                                    ~

Wednesday, 24 February 2016

What is software? Explain different types of software. - Computer Programming & Utilization (Material)



what is software? Explain different types of software.
Answer:

                   Software is collection of programs and program is collection of instruction.
                   It is logical component of computer, which cannot touch.
                   It is used to handle the hardware of computer.
                   Mainly two type of software are available.

I)                    System Software
II)                  Application Software

1)      System Software:
·         System software is designed to operate the computer hardware.
·         It is also provide platform for running application software.
·         Types of system software:
Operating system
System support software
System development software

Operating system:

·         It is the interaction between hardware and software.
·         Ex: DOS, Windows-XP, VISTA, LINUX, UNIX… 

System Support Software:

·         It mange the hardware more efficiently.
·         Ex: Drivers of the I/O devices, Antivirus software's.
·         Driver is a one type of interfacing program which can interacts between I/O devices and O.S.

System Development Software:

·         It provides the environment to user to develop application software's.
·         Ex: Editor: It is used to create the programs and modify the programs.
·         Pre-processor: It is used before translators (compilers, editors), which is used to replace some segments of the code with some another segment.
·         Compilers: It is the software which translates high level programs into low level programs.
·         Interpreters: It is the software which translates line high level programs into low level programs.
·         Loaders: It is the software which can load object codes into main memory and execute it. 

  2) Application Software:
       Application software is designed to perform specifict user applications. 
There are two categories of application software. 
I)                   General-purpose software 
II)                Specific-purpose software
General-purpose software:
       Microsoft office, Oracle

Specific-purpose software:
Tax calculation software,  Pay-roll system, banking software’s etc.