1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Allisa [31]
3 years ago
8

Write a program which populates an array with integer values read from a file. We do not know how many integers are in the file,

so you must loop until the end of the file is reached. For this problem, you may NOT use the function feof(). Instead, use the result returned from fscanf() to determine the end-of-file. Recall, we can set the result of fscanf() to an integer variable, and check to see if the integer variable is equal to the EOF marker. The program must take the items in the array and reverse them. You may use one array only to solve this problem.
Computers and Technology
1 answer:
max2010maxim [7]3 years ago
5 0

Answer:

#include <stdio.h>

#include <stdlib.h>

#include <string.h>

int main()

{

int arr[100];

int i = 0;

int j = 0;

char c[10];

char temp;

int sum = 0;

FILE* fp;

if ((fp = fopen("test.txt", "r")) == NULL) {

printf("cannot open the file");

return;

}

else {

do {

temp = fgetc(fp);

if (temp == ' ' || temp == '\n') {

c[j] = '\0';

arr[i++] = atoi(c);

j = 0;

continue;

}

c[j++] = temp;

} while (temp != EOF);

for (j = i - 1; j >= 0; j--) {

printf("%d\n", arr[j]);

}

}

getchar();

}

Explanation:

You might be interested in
How do I make my own extension for chrome?
Alexeev081 [22]
Open your browser and click the 3 strip bar in the conner and then look toward the bottom and click settings and it will open a new browser and then you are going to look at the left side and you will see extension click it and there you go...

4 0
3 years ago
The _____ model of a systems development life cycle provides for progressive development of operational software, with each rele
dimaraw [331]

Answer:

B. Incremental Build life cycle

Explanation:

RAD life cycle: RAD model of software development life cycle is all about coming up with prototype as soon as possible. It describes a method of software development which heavily emphasizes rapid prototyping and iterative delivery.

Incremental build life cycle: In incremental build model of software development life cycle, each release of the software have added capabilities. The development is finished when the user is okay with the present features. Focus is put on creating a working prototype first and adding features in the development life cycle. This is the correct option.

Waterfall life cycle: In a waterfall model, each phase must be completed fully before the next phase can begin and this usually takes time before a working software can be released. There is also no overlapping in the phases.

Spiral life cycle: Spiral Model can be pretty costly to use and doesn't work well for small projects. It's a risk-driven model which means that the overall success of a project highly depends on the risks analysis phase.

4 0
3 years ago
Read 2 more answers
Paul is playing a game when his computer shuts down unexpectedly. Paul has noticed recently that his fans are running very loud.
Elis [28]

Answer:

there is a lot of heat in his computer he should let the computer rest for some time and then use it again

5 0
3 years ago
A programmer completes the user manual for a video game she has developed and realizes she has reversed the roles of goats and s
lesya692 [45]

Answer:

Option C is correct.

Explanation:

The developer finalizes its client guide for such a pc game she might have created as well as discovers that she has changed the positions of sheep and goats across the whole article. Recognize the aim of a developer to modify both events of "goats" to "sheep" as well as all events of "sheep" to "goats." The developer will use an assumption that perhaps the term "foxes" would not exist anywhere else in the text.

The foregoing algorithms should be employed that achieve the aim of the author, which is to convert certain events of "goats" to "foxes." En, convert all events of "sheep" to "goats." Then, converts all events of "foxes" to "sheep."

4 0
3 years ago
Information is stored in what type of object in a database?
nydimaria [60]

Answer:

In Access, all data is stored in tables, which puts tables at the heart of any database. You might already know that tables are organized into vertical columns and horizontal rows.

Explanation:

4 0
2 years ago
Other questions:
  • 6. When you don't have enough room to stop, you may _______ to avoid what's in front of you.
    14·1 answer
  • According to the presentation, integrity and ethics are particularly important for careers in which of the following pathways?
    5·1 answer
  • The tremendous diversity ofthe source system is the primary reason for their complexity. Doyou agree/ If so, explain briefly why
    11·1 answer
  • A drug like cocaine cause more dopamine to be produce in the brain
    15·2 answers
  • Sites like Zillow get input about house prices from a database and provide nice summaries for readers. Write a program with two
    12·1 answer
  • In which country did the World Cyber Games originate?
    9·2 answers
  • WILL GIVE BRAINLIEST AND 30 POINTS!! NEED ASAP!!!!
    10·1 answer
  • The keyboard shortcut to enter the current date in a field is
    11·1 answer
  • PLZ HELP!!! I'm a beginner in coding!
    15·1 answer
  • Identify the reasons that numeric data representation is important to computer programmers. Check all that apply.
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!