CS 15900 Exam 1 Memorize

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/7

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

8 Terms

1
New cards

Implicit

Data Type Conversion: 0.5 / 2;

Usually when smaller data type is converted to large to prevent data loss.

2
New cards

Explicit

Data Type Conversion: (int)

Manually converts one data type to another using the cast operator (). It is used when there is a possibility of data loss, or when the compiler cannot perform the conversion automatically.

3
New cards

Assignment

Data Type Conversion:

int Volume;

float triangle;

volume = triangle/ 2;

The one where there is promotion( if variable has higher than expression to the right) and demotion( if variable has lower than expression on the right). Whatever the variable data type is on left is what the data type of the expression on the right will be converted to.

4
New cards

%{width}.{precision}{size}{conversion code}

What is each part of this: %2.4lf

5
New cards

width modifier

Is used to specify the minimum number of positions to reserve for the output of a value

6
New cards

precision modifier

For the number of decimal places being placed. won’t work for int

7
New cards

Conversion Code

They are the type you want your value to be printed as such as char(c), int(d), and float(f)

8
New cards

Size Modifier

They are how long or short you want your value to be such as h for short or l for long. In lf for double, l would be this while f represents float. Ex: %2.4lf