Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
0 views
c program
C programming
Uploaded by
lakshmipriyapriya200715
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save c program For Later
Download
Save
Save c program For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
0 views
c program
C programming
Uploaded by
lakshmipriyapriya200715
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save c program For Later
Carousel Previous
Carousel Next
Save
Save c program For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 4
Search
Fullscreen
The C Declarations * © baa ype Maa TrateDa type] | [er Deed Daw ype Teche ‘inten Erucraon epteet t em Hoang pia J > float > double } long doubte| Figure2.5 Cate typos | C-data type ean be classified as follows: | (i) Basic Data Type: (a) Integer (int), (b) character (char) , (C) floating point (float) , (d) double floating point (double). (ii) Derived Data Type: Derived data types are pointers, functions and arrays. Pointers are in Chapter 9, functions are explained in Chapter 10 and arrays are explained in Gili) User-defined Type: Struct, union and typedef are user-defined data types, which are ij __ explained in Chapter 13. |G) void Data Type: This datatype is explained in Chapter 10, ee meEEE — ming in C a es egors (Gomtinued) ‘ong itogers (0 IEEE: “ Example’ i ye1234567 oe ni234567) eyword, the or Long keywo aoe (b) Integers Signed and Unsi Table 2.7. and unsigned is given in nthe signed integ The difference betw ned and unsigned integers Table27 0 2 bytes in memory Occupies Range: 0 to 65535 Format specifier is 8u gned int is short unsigned in By default w There are also long unsigned int with range 0 to 4294967295 Example: gned long b=567898; ned short int c=223; When a variable is declared as unsigned the negative range of the data type is transferred to positive, i.e. doubles the largest size of the possible value. This is) to declaring unsigned int; the 16 bit is free and m used to store the sign of the number. Brief description on these data types is given in Tabl Table 28 Difference between signed and unsigned char igned Character Unsigned Character Occupies | bytes in memory Range: 0 to 255 Format specifier: $c Oceupies 1 bytes in memory Ri ge: 128 to 127 Format specifier: When printed using Prints ASCIT Cha: puts tel format specifier, When printed using %c format specifier, character prints ASCII character unsigned char =\pr Fl oats and Doubles: Table 2.9 shows the description of floats and douby, floa eThe C Declarations # 43 9 Difference between floating and double floating ik Double Floating “Float ‘Occupies 4 bytes in memory Occupies 8 bytes in memory Range: 3 Ae~38 to 43.4048 Range: 1.7 e308 10 +1.76+308 Format string Format string: 81f Pxample Example: double yi TThere also exist Long double having ranged 3.4e ~ 4932 to L.le + 4932 and occupies 10 bytes in memory. Example long double ki (4) _ Entire data types in C: The entire data types supported by the Cas illustrated above are given in Table 2.10 for the convenience of the reader for understanding. Table 210 Data types and ther control strings Data Type Size (ytes)___Range Format String rae 1 © 12810 127 * 1 010255 se 2 32,768 to 32,767 si or td 2 0 10 65535 su 4 -2147483648 to 2147483647 1d 4 010 4294967295 elu 4 34e-381034e+38 sf or tg 8 17-3080 1.7 €+ 308 ale 10 34esoa2tole+4932 SE wt a 32768 to 32767 aa ~The sine may vary according to the numberof variables used with enum datatype, 2.12 INTEGER AND FLOAT NUMBER REPRESENTATIONS 2.12.1 | Integer Representation Recall that an integer with sign is called a signed integer. The signed integer hes signs positive or negative. The signs are represented in the computer in the binary format as | for ~ (minus) oi for + (plus) or vibelrerin. The sign bits aivopyeetee oy Taupe (EGS) ) ie of storing the signed number, system reserves the leftmost bit for the representation of the sign of the number. For example, positive signed numbel form. In this form, the sign is represented by binary form. +7 is represented as 0 0000111 15 are represented in the form called signed magnitude yy a binary 0 and the remaining magnitude by equivalentSe 44 ¢ Programming in C ‘The signed negative integers can be represented in any one of the following forms: (a) signed—magnitude form (6) signed—t’s complement form (©) signed—2’s complement form In the signed magnitude form, the sign of the number is represented as 1 and the magnitude lent binary form. Example: Tis represented as 1 0000111 In the signed 1's complement form, the sign of the integer is indicated by shown in 1’s complement form as follows, 7 is represented as 1 1111000 1 and the m ment form as follows, ~1 is represented by 1 1111001 2.12.2 | Floating-Point Representation In most of the applications, fractions are often used. The system of the number represen keeps track of the position of binary and decimal point is better than the fixed-point repre “ -point representation. a a fractional part, The real number is a ers are either positive or negative. The re 4.4 or A545 % 10°. This type of Bee soiicon ee a ‘this scientific form, any number can be expressed as cor we can say the number ‘n’ can be expressed as n=mre of the number system and e is the exponent. Mantissa is s the position of the binary or decimal point. For € indicates the plus sign, Most of the computers
You might also like
Programming in C Chapter 3
PDF
No ratings yet
Programming in C Chapter 3
13 pages
Chapter 1
PDF
No ratings yet
Chapter 1
618 pages
3.0 Data Types in C
PDF
No ratings yet
3.0 Data Types in C
16 pages
Data Types Material
PDF
No ratings yet
Data Types Material
6 pages
Notes
PDF
No ratings yet
Notes
42 pages
Notes
PDF
No ratings yet
Notes
32 pages
3151 - Data Types in C
PDF
No ratings yet
3151 - Data Types in C
7 pages
2
PDF
No ratings yet
2
16 pages
Lecture 5,6 Escape Charecters and Data Types in C
PDF
No ratings yet
Lecture 5,6 Escape Charecters and Data Types in C
16 pages
Lec 06
PDF
No ratings yet
Lec 06
15 pages
C Basic Data Types
PDF
No ratings yet
C Basic Data Types
16 pages
Princeton University COS 217: Introduction To Programming Systems C Primitive Data Types
PDF
No ratings yet
Princeton University COS 217: Introduction To Programming Systems C Primitive Data Types
5 pages
04 Data Types
PDF
No ratings yet
04 Data Types
13 pages
C_Programming__2_
PDF
No ratings yet
C_Programming__2_
71 pages
C Data Type Note
PDF
No ratings yet
C Data Type Note
22 pages
Programing in C - A Study Material
PDF
No ratings yet
Programing in C - A Study Material
90 pages
CP Full
PDF
No ratings yet
CP Full
74 pages
3. Data Type Modifier-2
PDF
No ratings yet
3. Data Type Modifier-2
39 pages
Data Types
PDF
No ratings yet
Data Types
6 pages
Vision Cs 2024 Data Sturcture Programming C Programming 15
PDF
No ratings yet
Vision Cs 2024 Data Sturcture Programming C Programming 15
33 pages
C
PDF
No ratings yet
C
161 pages
2 Data Types
PDF
No ratings yet
2 Data Types
15 pages
C Fundamental Part3
PDF
No ratings yet
C Fundamental Part3
7 pages
CPNM Lecture 2 - Basic Data Types and Formatted Input Output
PDF
No ratings yet
CPNM Lecture 2 - Basic Data Types and Formatted Input Output
31 pages
Lect 6 Programming Logic Using ‘C’ Data Types
PDF
No ratings yet
Lect 6 Programming Logic Using ‘C’ Data Types
30 pages
C-Var Defs, Data Types
PDF
100% (1)
C-Var Defs, Data Types
21 pages
Lec 05
PDF
No ratings yet
Lec 05
18 pages
Data Types in C
PDF
No ratings yet
Data Types in C
11 pages
data types
PDF
No ratings yet
data types
3 pages
Data Type in C
PDF
No ratings yet
Data Type in C
15 pages
Data Types in C-1
PDF
No ratings yet
Data Types in C-1
13 pages
Gopi b.com CA c Notes Final
PDF
No ratings yet
Gopi b.com CA c Notes Final
84 pages
Lec 02 Part 2 Variables
PDF
No ratings yet
Lec 02 Part 2 Variables
42 pages
Research Work
PDF
No ratings yet
Research Work
9 pages
KCA102 Unit1 - Datatypes
PDF
No ratings yet
KCA102 Unit1 - Datatypes
12 pages
Data type
PDF
No ratings yet
Data type
3 pages
Fundamentals C Programming
PDF
No ratings yet
Fundamentals C Programming
53 pages
primary Data types
PDF
No ratings yet
primary Data types
2 pages
2022-09-06 Lecture 07 - Program Control - Ii
PDF
No ratings yet
2022-09-06 Lecture 07 - Program Control - Ii
12 pages
Software Project: Instructor: Roded Sharan, Roded@post - Tau.ac - Il TA: Dana Silverbush Course Materials: Virtual - Tau.ac - Il
PDF
No ratings yet
Software Project: Instructor: Roded Sharan, Roded@post - Tau.ac - Il TA: Dana Silverbush Course Materials: Virtual - Tau.ac - Il
33 pages
Chap 2
PDF
No ratings yet
Chap 2
48 pages
Data Types in C
PDF
No ratings yet
Data Types in C
7 pages
Computer Fundamentals Notes by Nida Afaq Warsi
PDF
No ratings yet
Computer Fundamentals Notes by Nida Afaq Warsi
7 pages
Types Sizes
PDF
No ratings yet
Types Sizes
2 pages
BIT104 SLM Library - SLM - Unit 04
PDF
No ratings yet
BIT104 SLM Library - SLM - Unit 04
26 pages
Lecture 3 CP - II
PDF
No ratings yet
Lecture 3 CP - II
20 pages
Unit - I To C Programming, Operators & Expressions To C Programming
PDF
No ratings yet
Unit - I To C Programming, Operators & Expressions To C Programming
21 pages
Programming With C++ - (Chapter 3. Fundamental Data Types in C++)
PDF
No ratings yet
Programming With C++ - (Chapter 3. Fundamental Data Types in C++)
24 pages
(Lect. 4) Token Variable Constant
PDF
No ratings yet
(Lect. 4) Token Variable Constant
27 pages
Data Types
PDF
No ratings yet
Data Types
11 pages
MC0061
PDF
No ratings yet
MC0061
75 pages
Datatype and Typeconversion
PDF
No ratings yet
Datatype and Typeconversion
6 pages
Scientific Programming in C II. Data Types: Susi Lehtola
PDF
No ratings yet
Scientific Programming in C II. Data Types: Susi Lehtola
19 pages
Alphabets:: Constants, Variables and Keywords in C
PDF
No ratings yet
Alphabets:: Constants, Variables and Keywords in C
11 pages
Unit-2 Com
PDF
No ratings yet
Unit-2 Com
25 pages
Part 2C Lang - Programiz.lwk
PDF
No ratings yet
Part 2C Lang - Programiz.lwk
8 pages
Lec 3.1 Variables
PDF
No ratings yet
Lec 3.1 Variables
22 pages
Lecture 2
PDF
No ratings yet
Lecture 2
37 pages
Simple Data Types in C: Alan L. Cox Alc@rice - Edu
PDF
No ratings yet
Simple Data Types in C: Alan L. Cox Alc@rice - Edu
41 pages