100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

CNIT 105 Final Exam Questions with correct Answers

Rating
-
Sold
-
Pages
14
Grade
A+
Uploaded on
05-08-2024
Written in
2024/2025

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

Institution
CNIT
Course
CNIT









Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
CNIT
Course
CNIT

Document information

Uploaded on
August 5, 2024
Number of pages
14
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Content preview

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;

Get to know the seller

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.
julianah420 Phoenix University
View profile
Follow You need to be logged in order to follow users or courses
Sold
656
Member since
2 year
Number of followers
324
Documents
33952
Last sold
22 hours ago
NURSING,TESTBANKS,ASSIGNMENT,AQA AND ALL REVISION MATERIALS

On this page, you find all documents, package deals, and flashcards offered by seller julianah420

4.3

149 reviews

5
101
4
20
3
8
2
5
1
15

Recently viewed by you

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

Frequently asked questions