Fundamentals of C Programming / C Language



Long Double
 

  •      It takes 10 bytes in memory.
  •      Used to store very large floating values.

Character Variables:

  • Character data type consists of alphabetic characters, numeric digits and special character.
  • It takes 1 byte in memory.

Declaration of Variables

  • Name of a variable and the Variable Type it can hold is called declaration of the variable
  • When a variable is declared, it occupies some memory space according to its data type.
  • Value of variable is stored in this memory.
  •  (e.g) n Int marks;

Data Type                               Variable Name

Examples

  • Short int Marks;
  • Long int Length;
  • Float Height;
  • Double Distance;
  • Char Single;
  • Int Marks, Rollno, Age;

Initialization of Variables:

  • Assigning a value to variable at declaration time is called initialization of the variable.
  • (e.g) Int a=110, b=60, c; Float num=6.78f; Char sin=‘M’;

COMMENTS:

  • Compiler can’t read these statements.
  • Used to add remarks or comments in a program.
  • Usually given to explain logic of program.
  • For Single line comment
  • //  comments
  • For multi line comments

/* comments comments */

  • (e.g.) c=a +b;        // Addition of two numbers

 

INPUT AND OUTPUT STATEMENTS:

  • Statements that are used to provide data to the program during its execution are called input statements.
  • Function used for input are

–  scanf Function

–  gets Function

–  getch Function

–  getche Function

  • Statements that are used to show data to an output device are called output statements.
  • Function used for output are

–  printf Function

–  puts Function

  • scanf and printf are most common used functions.
  • These functions are defined in the “Stdio.h” header file.

#include <stdio.h>

Example:

About Saweel Ur Raheem

Check Also

MCSE Notes Lecture # 4 : Applying Security to Folders

LECTURE 4 APPLYING SECURITY ON FOLDERS: Open Folder Options. Go to View Tag and uncheck ...

© Copyrights 2014. All rights are reserved www.latestcontents.com