1 / 10

Data Types

Data Types. Introduction. Booleans. Examples are : . x AND y - returns True if both x and y are true; returns False if either x or y are false. x OR y - returns True if either x or y, or both x and y are true; returns False only if x and y are both false.

oliver
Download Presentation

Data Types

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Data Types

  2. Introduction

  3. Booleans Examples are: • x AND y - returns True if both x and y are true; returns False if either x or y are false. • x OR y - returns True if either x or y, or both x and y are true; returns False only if x and y are both false. • x XOR y - returns True if only x or y is true; returns False if x and y are both true or both false. • NOT x - returns True if x is false (or null); returns False if x is true.

  4. Characters • Examples are: A, 1, +, ! & #

  5. Floating points Examples are: • The numbers 5.5, 0.001, and -2,345.6789 are floating point numbers.

  6. integers Examples are: • The numbers 10, 0, -25, and 5,148 are all integers.

  7. arrays • Examples are: arrayname[0] = "This ";arrayname[1] = "is ";arrayname[2] = "pretty simple."; print arrayname[0];print arrayname[1];print arrayname[2];

  8. Strings • Examples are: using System; class Strings { static void Main() { string word = "ZetCode"; char c = word[0]; Console.WriteLine(c); } }

  9. Record types • Examples are: Supported COBOL Data Types COMP-1 A 4-byte, single precision, floating-point Real data type that specifies internal floating-point items. The sign is contained in the first bit of the leftmost byte, and the exponent is contained in the remaining seven bits of that byte. The remaining three bytes hold the mantissa. COMP-2 An 8-byte, double precision, floating-point Real data type that specifies internal floating-point items. The sign is contained in the first bit of the leftmost byte, and the exponent is contained in the remaining seven bits of the first byte. The remaining seven bytes hold the mantissa.

  10. conclusion

More Related