GUIDED BY- A.S.MODI MADE BY- 1. SHWETA ALWANI 2. PRIYANKA.

Slides:



Advertisements
Similar presentations
Variables in C Amir Haider Lecturer.
Advertisements

Chapter 8: Arrays.
Data Types in C. Data Transformation Programs transform data from one form to another –Input data  Output data –Stimulus  Response Programming languages.
Unions The storage referenced by a union variable can hold data of different types subject to the restriction that at any one time, the storage holds data.
What is a pointer? First of all, it is a variable, just like other variables you studied So it has type, storage etc. Difference: it can only store the.
1 C++ Syntax and Semantics The Development Process.
Chapter 3: Beginning Problem Solving Concepts for the Computer Programming Computer Programming Skills /1436 Department of Computer Science.
Dale/Weems/Headington
Arrays Hanly - Chapter 7 Friedman-Koffman - Chapter 9.
Multiple-Subscripted Array
Chapter 5 - Arrays CSC 200 Matt Kayala 2/27/06. Learning Objectives  Introduction to Arrays  Declaring and referencing arrays  For-loops and arrays.
WEL COME PRAVEEN M JIGAJINNI PGT (Computer Science) MCA, MSc[IT], MTech[IT],MPhil (Comp.Sci), PGDCA, ADCA, Dc. Sc. & Engg.
Data Types.
‘C’ LANGUAGE PRESENTATION.  C language was introduced by Dennis Ritchie..  It is a programming language, which can make a interaction between user and.
WEL COME PRAVEEN M JIGAJINNI PGT (Computer Science)
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.
ECE 103 Engineering Programming Chapter 10 Variables, AKA Objects Herbert G. Mayer, PSU CS Status 6/19/2015 Initial content copied verbatim from ECE 103.
Chapter 2: C Fundamentals Dr. Ameer Ali. Overview C Character set Identifiers and Keywords Data Types Constants Variables and Arrays Declarations Expressions.
CHAPTER 7 DATA HANDALING Prepared By Prepared By : VINAY ALEXANDER ( विनय अलेक्सजेंड़र ) PGT(CS),KV JHAGRAKHAND.
Variables and Data Types
By Sidhant Garg.  C was developed between by Dennis Ritchie at Bell Laboratories for use with the Unix Operating System.  Unlike previously.
DCT1063 Programming 2 CHAPTER 5 ADVANCED DATA TYPE (part 1) Mohd Nazri Bin Ibrahim Faculty of Computer Media and Technology TATi University College
C Tokens Identifiers Keywords Constants Operators Special symbols.
Data & Data Types & Simple Math Operation 1 Data and Data Type Standard I/O Simple Math operation.
C STRUCTURES. A FIRST C PROGRAM  #include  void main ( void )  { float height, width, area, wood_length ;  scanf ( "%f", &height ) ;  scanf ( "%f",
CISC105 – General Computer Science Class 9 – 07/03/2006.
M.T.Stanhope Oct Title : C++ Basics Bolton Institute - Faculty of Technology (Engineering) 1 C++ Basics u Data types. u Variables and Constants.
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.
C++ Character Set It is set of Characters/digits/symbol which is valid in C++. Example – A-Z, (white space) C++ Character Set It is set of.
Fundamentals of C and C++ Programming. EEL 3801 – Lotzi Bölöni Sub-Topics  Basic Program Structure  Variables - Types and Declarations  Basic Program.
Copyright 2005, The Ohio State University 1 Pointers, Dynamic Data, and Reference Types Review on Pointers Reference Variables Dynamic Memory Allocation.
ISBN Chapter 6 Data Types Introduction Primitive Data Types User-Defined Ordinal Types.
Pointers A pointer is a variable that contains a memory address as it’s value. The memory address points to the actual data. –A pointer is an indirect.
Chapter 3 – Variables and Arithmetic Operations. Variable Rules u Must declare all variable names –List name and type u Keep length to 31 characters –Older.
Data Types Declarations Expressions Data storage C++ Basics.
Data Structure and c K.S.Prabhu Lecturer All Deaf Educational Technology.
Slides created by: Professor Ian G. Harris Hello World #include main() { printf(“Hello, world.\n”); }  #include is a compiler directive to include (concatenate)
Slide 1 Chapter 5 Arrays. Slide 2 Learning Objectives  Introduction to Arrays  Declaring and referencing arrays  For-loops and arrays  Arrays in memory.
Chapter 5 Arrays. Copyright © 2006 Pearson Addison-Wesley. All rights reserved. 5-2 Learning Objectives  Introduction to Arrays  Declaring and referencing.
Computer And Programming Array and Pointer. Array provides a means to allocating and accessing memory. Pointers, on the other hand, provides a way to.
COMP 102 Programming Fundamentals I Presented by : Timture Choi COMP102 Lab 011.
CHAPTER 2 PROBLEM SOLVING USING C++ 1 C++ Programming PEG200/Saidatul Rahah.
Department of Electronic & Electrical Engineering Types and Memory Addresses Pointers & and * operators.
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.
 Variables are nothing but reserved memory locations to store values. This means that when you create a variable you reserve some space in memory. 
Silberschatz and Galvin  C Programming Language Kingdom of Saudi Arabia Ministry of Higher Education Al-Majma’ah University College of Education.
Variables in C Topics  Naming Variables  Declaring Variables  Using Variables  The Assignment Statement Reading  Sections
Variables in C Topics  Naming Variables  Declaring Variables  Using Variables  The Assignment Statement Reading  Sections
Programming in C Arrays, Structs and Strings. 7/28/092 Arrays An array is a collection of individual data elements that is:An array is a collection of.
CMSC 104, Version 8/061L09VariablesInC.ppt Variables in C Topics Naming Variables Declaring Variables Using Variables The Assignment Statement Reading.
1 A more complex example Write a program that sums a sequence of integers and displays the result. Assume that the first integer read specifies the number.
Chapter 5 Arrays Copyright © 2016 Pearson, Inc. All rights reserved.
1 C++ Data Types structured array struct union class address pointer reference simple integral enum char short int long bool floating float double long.
Windows Programming Lecture 03. Pointers and Arrays.
C LANGUAGE UNIT 3. UNIT 3 Arrays Arrays – The concept of array – Defining arrays – Initializing arrays.
Chapter 2 Variables and Constants. Objectives Explain the different integer variable types used in C++. Declare, name, and initialize variables. Use character.
BASIC ELEMENTS OF A COMPUTER PROGRAM
Variables A variable is a placeholder for a value. It is a named memory location where that value is stored. Use the name of a variable to access or update.
Lecture2.
By: Syed Shahrukh Haider
CSE101-Lec#3 Components of C Identifiers and Keywords Data types.
Variables ,Data Types and Constants
DATA HANDLING.
Advanced Programming Basics
CSE 100 Data Types Declarations Displays.
Variables T.Najah Al_Subaie Kingdom of Saudi Arabia
C Language B. DHIVYA 17PCA140 II MCA.
C Programming Lecture-3 Keywords, Datatypes, Constants & Variables
Variables and Constants
Presentation transcript:

GUIDED BY- A.S.MODI MADE BY- 1. SHWETA ALWANI 2. PRIYANKA

When we wish to store data in a C++ program, such as a whole number or a character, we have to tell the compiler which type of data we want to store. The data type will have characteristics such as the range of values that can be stored and the operations that can be performed on variables of that type. C++ data types are of two types 1.FUNDAMENTAL TYPES 2.DERIVED TYPES

Fundamental data types are those that are not compose of other data type There are five types of data type- 1.int data type (for integer) 2.Char data type (for character) 3.Float data type 4.Void data type

int data type The integer type is used for storing whole numbers. We can use signed, unsigned or plain integer values as follows: signed int index = 41982; signed int temperature = -32; unsigned int count = 0; int height = 100; int balance = -67; Char data type The character type is used to store characters - typically ASCII characters but not always. For example: char menu Selection = 'q'; char user Input = '3';

Float data type Floating point types can contain decimal numbers, for example 1.23, There are three sizes, float (single-precision), double (double-precision) and long double (extended- precision). Some examples: float Celsius = ; double Fahrenheit = ; long double account Balance = Void data type A data type that has no values or operators and is used to represent nothing

Derived data types are those that are defined in terms of other data types, called base types. Derived types may have attributes, and may have element or mixed content There are five types of derived data types 1.Arrays 2.Structure 3.Pointer 4.References 5.Constants

ARRAYS C++ Arrays are the data structures which can be used to store consecutive values of the same data types. C++ Arrays can be declared for all c++ data types viz., int, float, double, char, struct, char etc., All the values are stored in consecutive memory locations. The values can be accessed by using the position of the stored value.data structures store data types c++ data types CONSTANT The const keyword specifies that a variable's value is constant and tells the compiler to prevent the programmer from modifying it.

REFERENCE A reference is an alias or an alternative name for an object. All operations applied to a reference act on the object to which the reference refers. The address of a reference is the address of the aliased object. Pointer A pointer in C++ is said to "point to" the memory address that is stored in it. Also, when defining a C++ pointer variable, we must specify the type of variable to which it is pointing. For example, to define a pointer, which will store a memory address at which exists an int, we can do the following:

. FUNCTIONS Functions are building blocks of the programs. They make the programs more modular and easy to read and manage. All C++ programs must contain the function main( ). The execution of the program starts from the function main( ). A C++ program can contain any number of functions according to the needs

There are four types of user defined derived data type: 1.CLASS 2.UNION 3.STRUCTURE 4.ENUMERATION

UNION A union is a user-defined data or class type that, at any given time, contains only one object from its list of members (although that object can be an array or a class type). Structure Structure is a collection of variables under a single name. Variables can be of any type: int, float, char etc. The main difference between structure and array is that arrays are collections of the same data type and structure is a collection of variables under a single name

ENUMERATIONS An enumeration is a user-defined type consisting of a set of named constants called enumerators. CLASS A class in C++ is an encapsulation of data members and functions that manipulate the data. The class can also have some other important members which are architecturally important.