100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
CNIT 105 Final Exam Questions with correct Answers $14.99   Add to cart

Exam (elaborations)

CNIT 105 Final Exam Questions with correct Answers

 4 views  0 purchase
  • Course
  • CNIT
  • Institution
  • CNIT

Exam of 14 pages for the course CNIT at CNIT (CNIT 105 Final Exam)

Preview 2 out of 14  pages

  • August 5, 2024
  • 14
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
  • CNIT
  • CNIT
avatar-seller
julianah420
CNIT 105 Final Exam

Assume the following:

int num;
int * ptr;

Which statement will make the pointer point to variable num?

ptr = num;

ptr -> num;

ptr = &num - answerptr = &num

When should the end of the file be checked?

A. When opening the file.

B. When writing to the file.

C. When reading from the file.

D. When closing the file. - answerC. When reading from the file.

The text file scores.txt contains some integer numbers. It has been opened for reading
using the file pointer ptr.

Which statement will read the first number from the file into the variable score?

Assume: int score;


A. fscanf (ptr, "%d", score);

B. fscanf (ptr, "%d", &score);

C. fscanf ("%d", &score);

D. fscanf (ptr, &score); - answerB. fscanf (ptr, "%d", &score);

To work with a text file, which one of the following declarations is required?

, A. FILE ptr;

B. FILE * ptr;

C. File * ptr;

D. file * ptr; - answerB. FILE * ptr;

What does the function feof() return when the end of the file is reached?

A. it returns true (which is 1)

B. it returns the number of lines in the file.

C. It returns false (which is 0)

D. it returns -1 - answerA. it returns true (which is 1)

Assume the following declaration:

int num;
int * ptr;

Which statement will make the pointer point to variable num?

A. ptr = num;

B. ptr = #

C. ptr -> num;

D. ptr = # - answerD. ptr = #

Assume that the input file data.txt has been opened for reading using the file pointer
fptr.. The file contains several whole numbers:

34
55
90
22
100
16

Which of the following will read the third value into variable number?
Assume: int number;

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller julianah420. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $14.99. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

72042 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$14.99
  • (0)
  Add to cart