Knowledge Walls
Hyderabad, Andhra Pradesh, India
Introduction [cont'd]
Input Output Functions [cont'd]
Structures and Unions [cont'd]
# Preprocessor [cont'd]
Datatypes & Variables in Introduction of Programming in C
Define C datatype? 
Datatype is used to specify and allocate memory for variables. Datatype size is differ from machine to machine. C supports int, float, char and double datatypes. limits.h has all size range details for datatypes.
Define C variables? 
Variable is an identifier or user specified name stores a data value. Constant variables are unchanged during program execution.
Datatype details 
Datatype Usage Memory size Limits
int stores rounded decimal values 2 bytes 32, 768 to 32, 767
float stores decimal values 4 bytes 3.4e-38 to 3.4e+38
char stores a character 1 byte -128 to 127
double stores high ranges of decimal values 8 bytes 1.7e-308 to 1.7e+308
Variable declration Syntax 
Datatype [variable name 1],[variable name 2]...[variable name n];

int a,b,c;

Datatype variable-name = initial-value;
int a = 10;
void main(){
   int a,b,c;
   a = 10;
   b = 20;
   c = a + b;
Previous Topics
Previous lessons of current book.
Introduction of Programming in C
Introduction of Programming in C
Best Lessons of "Programming in C"
Top lessons which are viewed more times.
Structures and Unions of Programming in C
Input Output Functions of Programming in C
Structures and Unions of Programming in C
Sub Lessons
  Copyright © 2014 Knowledge walls, All rights reserved
keep your tutorials and learnings with KnowledgeWalls. Don't lose your learnings hereafter. Save and revise it whenever required.
Click here for more details