Data Types Always data types will decide which type of information we are storing into variables In C programming language we are having 3 types of basic.

Slides:



Advertisements
Similar presentations
For(int i = 1; i
Advertisements

STRING AN EXAMPLE OF REFERENCE DATA TYPE. 2 Primitive Data Types  The eight Java primitive data types are:  byte  short  int  long  float  double.
IT 325 OPERATING SYSTEM C programming language. Why use C instead of Java Intermediate-level language:  Low-level features like bit operations  High-level.
1 DATA ABSTRACTION: USER DEFINED TYPES AND THE CLASS.
Java Syntax Part I Comments Identifiers Primitive Data Types Assignment.
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall Office hours: M-F 11:00-11:
Primitives in Java Java has eight primitive types –boolean –integral types: signed: long, int, short, byte unsigned: char –floating point types: double,
©2004 Brooks/Cole Chapter 2 Variables, Values and Operations.
Objects vs. Primitives Primitive Primitive byte, short, int, long byte, short, int, long float, double float, double char char boolean boolean Object (instance.
Variables and constants Applications of Computer Programming in Earth Sciences Instructor: Dr. Cheng-Chien LiuCheng-Chien Liu Department of Earth Sciences.
Fundamental data types Horstmann Chapter 4. Constants Variables change, constants don't final = ; final double PI = ; … areaOfCircle = radius *
‘C’ LANGUAGE PRESENTATION.  C language was introduced by Dennis Ritchie..  It is a programming language, which can make a interaction between user and.
Data Type. A data type defines a set of values that a variable can store along with a set of operations that can be performed on that variable. Common.
Variables and Data Types
C Tokens Identifiers Keywords Constants Operators Special symbols.
More arrays Primitive vs. reference parameters. Arrays as parameters to functions.
Data Types. Data types Data type tells the type of data, that you are going to store in memory. It gives the information to compiler that how much memory.
GUIDED BY- A.S.MODI MADE BY- 1. SHWETA ALWANI 2. PRIYANKA.
Primitive Variables.
Control Transfer and Arithmetic Conditional/Unconditional branches Delayed Control Transfer –Increases the efficiency of pipelining Annulled branches.
03 August 2004 NLP-AI Java Lecture No. 4 Operators & Decision Constructs Satish Dethe.
Primitive Variables.
Big Endian vs. Little Endian Storage of Numeric Data Noah Mendelsohn Tufts University Web:
Java Programming, Second Edition Chapter Two Using Data Within a Program.
1.2 Primitive Data Types and Variables
Quick Review of OOP Constructs Classes:  Data types for structured data and behavior  fields and methods Objects:  Variables whose data type is a class.
By Anand George SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)
Department of Electronic & Electrical Engineering Types and Memory Addresses Pointers & and * operators.
Primitive Data Types 1 In PowerPoint, point at the speaker icon, then click the "Play" button.
 Variables are nothing but reserved memory locations to store values. This means that when you create a variable you reserve some space in memory. 
Chapter 2. Variable and Data type
Test Review. General Info. All tests will be comprehensive. You will be tested more on your understanding of code as opposed to your ability to write.
LESSON 5 – Assignment Statements JAVA PROGRAMMING.
CPSC 233 Tutorial 5 February 9 th /10 th, Java Classes Each Java class contains a set of instance variables and methods Instance Variables: Type.
 Data Type is a basic classification which identifies different types of data.  Data Types helps in: › Determining the possible values of a variable.
1 2. Program Construction in Java. 01 Java basics.
1 Lecture # 2. * Introducing Programming with an Example * Identifiers, Variables, and Constants * Primitive Data Types * Byte, short, int, long, float,
Basic Data Types อ. ยืนยง กันทะเนตร คณะเทคโนโลยีสารสนเทศและการสื่อสาร มหาวิทยาลัยพะเยา Chapter 4.
Data Types and Input Output in C. Size of a Character in C #include int main() { char ch; ch = 'A'; printf("ch = %c\n",ch); printf("size of char = %d.
CPSC 233 Tutorial January 21 st /22 nd, Linux Commands.
Integer VariablestMyn1 Integer Variables It must be possible to store data items in a program, and this facility is provided by variables. A variable is.
Lecture 4 Monday Sept 9, Variables and Data Types ►A►A►A►A variable is simply a name given by the programmer that is used to refer to computer storage.
Chapter 2 Variables and Constants. Objectives Explain the different integer variable types used in C++. Declare, name, and initialize variables. Use character.
Topics introduced today (these topics would be covered in more detail in later classes) – Primitive Data types Variables Methods “for” loop “if-else” statement.
Objects as a programming concept
EPSII 59:006 Spring 2004.
Data Types The type states how much and what kind of data the variable can store. integers- whole numbers no fractional parts int, short, long floating.
C++ Arrays.
Variables ,Data Types and Constants
Computers & Programming Languages
Conversions of the type of the value of an expression
Principles of Computer Programming (using Java) Chapter 2, Part 1
Unit-2 Objects and Classes
Introduction to Programming
Lecture 8.
Computers & Programming Languages
Value Types and Reference Types
Local Variables, Global Variables and Variable Scope
Storing Information Each memory cell stores a set number of bits (usually 8 bits, or one byte) (byte addressable)
Java Programming Review 1
Programming Language C Language.
C Data Types and Variable
Introduction to Programming
Type Conversion It is a procedure of converting one data type values into another data type In C programming language we are having two types of type conversion.
Names of variables, functions, classes
Chapter 3 Introduction to Classes, Objects Methods and Strings
Subtype Substitution Principle
C Programming Lecture-3 Keywords, Datatypes, Constants & Variables
Variables and Constants
Data in a C++ Program Numeric data and character data
Presentation transcript:

Data Types Always data types will decide which type of information we are storing into variables In C programming language we are having 3 types of basic data types 1. char 2. int 3. float

. When the basic data types are not supporting user requirements then go for primitive data types primitive data types are constructed by extending the size and range of basic data types

. Type Size Range Format specifier Example char 1 byte -128 to +127 %c ‘a’ , ‘A’ unsigned char 0 to 255 int 2 byte -32768 to +32767 %d -25, 5, 0, -5 unsigned int 2 bytes 0 to 65535 %u 254, 36777 long int 4 bytes -2147483648 to +2147483647 %ld 45l, -5l, 5000l unsigned long 0 to 4294967295 %lu 1000l, 20000l float ±3.4*10±38 %f -3.5f ,125.13f double 8 bytes ±1.7*10±308 %lf -125.25 , 270.6 long double 10 bytes ±3.4*10±4932 %Lf -330.45L, -1.2L