Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 1 out of 3 pages
Exam (elaborations)

CSCI 1730 Exam 1 Questions with Correct Answers Latest Update 2025/2026

Document preview thumbnail
Preview 1 out of 3 pages

CSCI 1730 Exam 1 Questions with Correct Answers Latest Update 2025/2026 Size of a char - Answers 1 byte (8 bits) Size of a short - Answers 2 bytes (16 bits) size of an int - Answers 4 bytes (32 bits) size of a long - Answers 8 bytes (64 bits) size of a float - Answers 4 bytes (32 bits) size of a double - Answers 8 bytes (64 bits) size of a boolean - Answers 1 byte (4 bits) How do you compile code in C? - Answers gcc -Wall [filename].c -g -o [filename].out Ternary Operator - Answers condition ? result 1 : result 2 7 == 5 ? 4 : 3 (is 7 = 5?) yes: output 4 no: output 3 Stack - Answers This is where information is saved each time a function is called such as local (auto) variables in a method or function. The memory is then removed after the function is executed. Heap - Answers Where dynamic memory allocation takes place and is managed by malloc, realloc, calloc, and free. Memory stored in the heap has to be free'd at the end of the program to avoid memory leaks.

Content preview

CSCI 1730 Exam 1 Questions with Correct Answers Latest Update 2025/2026

Size of a char - Answers 1 byte (8 bits)

Size of a short - Answers 2 bytes (16 bits)

size of an int - Answers 4 bytes (32 bits)

size of a long - Answers 8 bytes (64 bits)

size of a float - Answers 4 bytes (32 bits)

size of a double - Answers 8 bytes (64 bits)

size of a boolean - Answers 1 byte (4 bits)

How do you compile code in C? - Answers gcc -Wall [filename].c -g -o [filename].out

Ternary Operator - Answers condition ? result 1 : result 2

7 == 5 ? 4 : 3

(is 7 = 5?)

yes: output 4

no: output 3

Stack - Answers This is where information is saved each time a function is called such as local
(auto) variables in a method or function. The memory is then removed after the function is
executed.

Heap - Answers Where dynamic memory allocation takes place and is managed by malloc,
realloc, calloc, and free. Memory stored in the heap has to be free'd at the end of the program to
avoid memory leaks.

Two's Complement - Answers The algorithm to get the negative of an integer.

-x == ~x + 1

how is the end of a string represented in a character sequence - Answers the null character '\0'

How can you change a character sequence after it is initialized. - Answers You cannot assign
them directly (char myword[ ] = "Hello"; myword = "Bye;). You must reassign each element
individually.

myword[0] = 'B';myword[1] = 'y';myword[2] = 'e';myword[3] = '\0';

What do pointers do - Answers When a variable is declared, its value is assigned to a specific

Document information

Uploaded on
December 14, 2025
Number of pages
3
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$10.49

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
joshuawesonga22
3.5
(14)
Sold
119
Followers
2
Items
15119
Last sold
15 hours ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions