M2 34 G2 M3 97 G3 M4 58 G4 M5 64 G5 84 84 A A 34 34 A A C C B B D D 97 97 58 58

# M2 34 g2 m3 97 g3 m4 58 g4 m5 64 g5 84 84 a a 34 34 a

• 35

This preview shows page 19 - 28 out of 35 pages.

M2= 34 , G2=? M3= 97 , G3=? M4= 58 , G4=? M5= 64 , G5=? 84 84 A A 34 34 A A C C B B D D 97 97 58 58 64 64 Marks as integer Grades as character char in C char in C char in C char in C char in C
©LPU CSE101 C Programming Classification of Data Types In C data type is broadly classified as: Basic data types Derived data types User defined data types
©LPU CSE101 C Programming List of Data Types Type Size (bytes) Minimal range char 1 -128 to 127 unsigned char 1 0 to 255 int 2 or 4 -32768 to 32767 unsigned int 2 or 4 0 to 65535 short int 2 -32768 to 32767 unsigned short int 2 0 to 65535 long int 4 -2147483648 to 2147483647 unsigned long int 4 0 to 4294967295 float 4 3.4e-38 to 3.4e+38 with 6 digits of precision double 8 1.7e-308 to 1.7e+308 with 15 digits of precision long double 10 3.4e-4932 to 1.1e+4932 with 20 digits of precision
©LPU CSE101 C Programming Integer It is used to store positive and negative counting numbers, as well as zero. {...,-2,-1,0,1,2,...} The numbers written in green box of My-Car problem are the integers. 15 15 84 84 34 34 97 97 Quick yak: Some integers used in common are: No. of steps in staircase Wheels in an automobile
©LPU CSE101 C Programming The type modifiers for the integer data type are: signed, unsigned, short, long . Signed types represent positive and negative numbers. Unsigned represent zero and positive numbers only. Long and short represent the range of integer number
©LPU CSE101 C Programming Long Integer Occupies 4 bytes in memory. Format specifier is %ld. Range is -2147483648 to 2147483647 long radius=123456; long int value ; Short Integer Occupies 2 bytes in memory. Format specifier is %d or %i. Range is -32768 to 32767. By default int variable is short signed int. int cost=100; short int si;
©LPU CSE101 C Programming Signed Integer Occupies 2 bytes in memory Format specifier is %d or %i There are also long signed integers having range from -2147483648 to 2147483647 Example: int firstvalue=10; long int WaterLevel ; Unsigned Integer Occupies 2 bytes in memory Format specifier is %u . There are also long unsigned int with range 0 to 4294967295 Example: unsigned long count=567898; unsigned short int page;
©LPU CSE101 C Programming Float Floating point numbers are real numbers that, unlike integers, may contain fractional parts of numbers, like 1.446 , -112.972 , 3.267e+27 .

#### You've reached the end of your free preview.

Want to read all 35 pages?

• Spring '18
• Aman
• Long integer, Short integer

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern