Thursday, 8 August 2013

Explain the basic structure of C program.



Every C program consist of one or more modules called function. One of the function must be called main. The program will always begin by executing the main function. Each function must contain.



  1.  A function heading , which consists of the function name, followed by an optional list of arguments, enclosed in parentheses.
  2.  A list of arguments declaration, if arguments are included in the heading.
  3. A compound statement which comprises the remainder of the function.



Discuss the various data type available in C Language.


The various data type available in C Language are:

  •  int data type :An integer is an integral whole number without a decimal point. Integer occupies 2 bytes of space in the memory.

  •  char data type :Character data type is used to represent single character. An character data type occupies 1 bytes of memory space.

  •  Float data type :A number having fractional part is a floating point number. 45-67 is a floating point number. A float data type occupies 4 bytes of memory space. Float values can store values with 6 to 7 digits of precision.

  • Double data type :Double data type is used for double precision floating number. Double data type occupies 8 byte of memory space. Double can store values with 14 to 15 digits of precision.
 

    No comments:

    Post a Comment