Pages

Thursday, 20 December 2012

Constant in C Language

Constant:

              The alphabets, numbers and special symbol when properly a combined from constants and variables and keywords. A constant is an entity that does not change where as a variable is an entity that may change.

Types of C Constant:

C constant can be divided in two major categories :
1) Primary constant.
2) Secondary constant.


These constant are further divide as 

Primary constant :                                            

a) Integer constant
b) Real constant
c) Character constant
d) Sting constant.

Secondary constant :

a) Array 
b) Pointer
c) Structure
d) Union
e) Enum etc.



Rules for constructing integer constants:

1) An integer constant must have at least one digit.
2) It must have one decimal point.
3) It can either be positive or negative.
4) If no sign than integer is considered to be positive.
5) No commas or blanks are allowed with in an integer constant.
6) The allowable range of an integer constant is -32768 to 32767.
   For example:
                    512, +126, -24 etc.

Rules for constructing real constants:

Real constant are often called floating points constant. The real constants could be written in two forms Fractional form and Exponential form.

1) A real constant must have digit.
2) It must have decimal point.
3) It could be either positive or negative.
4) Default sign is positive.
5) No commas or blanks are allowed with in a real constant.
    For example:
               +56.23, -456.01,76.875,-53792.1 etc  

Exponential form of representation of real constant :

In exponential form of representation of real constant is represented in two parts . The part appearing before "e" is called mantissa, where as the part following "e" is called exponent.

Following rules must be observed while constructing real constant expressed in exponential form.

1)  The mantissa part and the exponential part should be separated by a letter "e".
2) The mantissa part may have positive or negative sign.
3) Default sign of mantissa part is positive.
4) The exponent must have at least one digit, which must be a positive or negative integer. Default sign is positive.
5) Range of real constants expressed in exponential form is -3.4e38 to 3.4e38.
       For Example:
                      +3.2e-5,4.1e8,-0.2e+3 etc.

Rules for constructing character constant :

1) A character constant is a single alphabet, a single digit or a single special symbol enclosed with in single inverted commas. both the inverted commas should point to the left.
2) The maximum length of character constant can be 1 character.
  for example 
                    *A*  
       


Monday, 17 December 2012

C Language

What is c?

       c is a programming language developed at AT and TS bell laboratories of USA in 1972. It was designed written by a men named Dennis Ritchie.

Getting stated with c:

     However there is a close analogy between learning English and C language. The classical method of learning English is to first learn alphabets used in the language, then learn to combine these alphabets to form words which in turn are combined to form sentences and sentences are combined to form paragraphs
            Learning C is similar and easier instead of straight away learning how to write programs we must first know what alphabets, numbers and specials symbols are used in C, then how using them constants, variables and keywords are constructed and finally how these combined to form instruction. A group of instructions would be combined later on to form a program.This will explain by given structure.

   Steps in Learning English Language:

          Alphabets.......... > Words....... > Sentences....... > Paragraphs.


Steps In Learning C Language:

(1st  step)                       (2nd step)   

  Alphabets                 Constants                         (3rd step)             (4th step) 

      Digits                       Variables ............. >  Instruction......... > Program.

    Special symbols          Key words.


The Character set:

               A character denotes by alphabet , digit or special symbol used to represent information .

                                                                            Character code:

Alphabets  =     A, B ............Y,Z                      (65-90)

                            a , b.............y,z                      (97-122)

Digits =          0,1,2,3,4,5,6,7,8,9                    (48-57)

Special symbols =    ~ ` ! @ # $ % ^ & * ( ) + _ { } " : > < ? |   ( 0-47, 58-64,9196123-127 )      

       

            

Sunday, 16 December 2012

what is software

Software:

                 All computer program are called software that contain instruction for the system that what to do and how to do. in this part of computer system which consist of program and techniques that are necessary to get the hardware to work. we can see them but we can not touch them. we made software for computer because computer is a stupid device. it can not work without software.

Types of software: 

         Generally there are two types of software
      1) Appliction software.
      2) System software.

1) Application software:

                  These are that software that is used to perform any specialized functions and these are the programs which are used for the official use or for general purpose. without system software application software can not be installed.

Types of application software:

              There are two types of application software.
     1.1) General purpose software or application packages.
     1.2) Special purpose software or customized packages.

1.1) General purpose software:

       General purpose software is that software which is used for general purpose. General purpose software has enough features to accomplish a wide variety of tasks and they are easily available in the market and any one can used it according to his necessary.
for example:
                 Ms word, excel, auto cad, games etc.

2.1) Special purpose software:

       Special purpose software performs a very specific task and can not be change or programmed to perform a different task. It is specific for company institution, organization and even for a person.
for example:
    Bank software etc.

2) System software:

        All the software used to operate and maintain computer system are called system software.Without a system software, a computer is just an expensive hunk of junk. It work as a company administrator or as a class monitor.

 Types of system software:

     1) Operating system software.
     2) Translators.

2.1) Operating system software:

          A set of program used to control and monitor over all activites of a system is called operating system software.

Function of operating system software:

 1)  It provides interface or bridge between user and computer.
 2)  It is a heart of the system.
 3)  It manages hardware.
 4)  It manages software.
 5)  It manages memory.
 6)  It manages files. for example save, open and edit etc.

2.2) Language Translator: 

         Translator translate the users software into language that the "CPU" can understand. In other word language translators  are system software that converts application software into a specific machine language.

Types of Translator:

 1)  Compiler.
 2)  Interpreter.
 3)  Assembler.

2.2.1 Compiler: 

              Compiler are used for high level languages like c, c++ and java etc. Compiler check a program as a hole and notify all errors and then convert all the instruction to machine language or binary language and it is faster then the interpreter.

2.2.2) Interpreter:

            Interpreter is also used for high level languages like basic language etc. Interpreter check instruction step by step and then notify error other wise convert into machine language or binary language.

2.2.3) Assembler:

           The translator program that translates an assembly code into the computers machine code is called assembler. Assemblers are used for low level languages like Assemble language.

                  

Saturday, 15 December 2012

what is computer ?

Computer:

  Computer is an electronic device which recieve data process it and give result ( output ).
Or
  An electronic device that take some inputs process the input and produce output.