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
vichka [17]
3 years ago
9

Convert the following C program to C++.

Computers and Technology
1 answer:
ki77a [65]3 years ago
8 0

Answer:

The program equivalent in C++ is:

<em>#include <cstdio></em>

<em>#include <cstdlib></em>

#define SIZE 5

using namespace std;

<em>int main(int argc, char *argv[]) {</em>

<em>int numerator = 25;</em>

<em>int denominator = 10;</em>

<em>FILE * inPut = fopen(argv[1], "r");</em>

<em>FILE * outPut = fopen(argv[2], "w");</em>

<em>float result = (float)numerator/denominator;</em>

<em>fprintf(outPut,"Result is %.2f\n", result);</em>

<em>float arr[SIZE];</em>

<em>for(int i = 0; i < SIZE; i++) {</em>

<em>fscanf(inPut, "%f", &arr[i]);</em>

<em>fprintf(outPut, "%7.4f\n", arr[i]);</em>

<em>}</em>

<em>return 0;</em>

<em>}</em>

Explanation:

See attachment for explanation.

Each line were numbered with equivalent line number in the C program

Download cpp
You might be interested in
Can you give me a long list of kid's cartoons
Delicious77 [7]
SpongeBob, Teen Titan Go, Future Worm. That's all I can think!
8 0
3 years ago
Read 2 more answers
The web server software used has a significant impact on how a web site's web pages look on a user's computer.
soldi70 [24.7K]
False. Apache (which serves about 63% of the web pages) just serves the files. How it looks is a combination of the HTML and CSS that the site uses.
6 0
3 years ago
_______ is a variation of phishing that uses voice communication technology to obtain the information the attacker is seeking.
Zanzabum
It's voice phishing but it's also sometimes referred to as vishing 
4 0
3 years ago
Jameelah has files all over her computer. Thus, it is often difficult for her to find the files she is looking for.
VLD [36.1K]

Answer:

folders

Explanation:

it is a very good way to keep your desktop organized and keep tidy

3 0
3 years ago
John is researching the job of a quality control inspector. He thinks it would be fun to monitor the production process and test
Evgesh-ka [11]
Near-perfect eyesight and detail perception would be good traits to have. 
6 0
3 years ago
Read 2 more answers
Other questions:
  • Dashed lines that display on your slide when you are moving an object and that assist you with alignment are referred to as:
    12·2 answers
  • Once a virus has been removed by your anti-virus program, all traces of it are gone from your computer.
    9·1 answer
  • Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integer
    7·1 answer
  • What is the output of the following code segment? int n = 0; for (int k = 0; k&lt; 2; k++) {n=n +2;} cout &lt;&lt; n; oo 0 1 O O
    8·1 answer
  • i set up an account and paid the yearly fee, now it's asking me to join. i've tried to log in and brainly isn't accepting my ema
    8·1 answer
  • Who is the father of computer​
    12·2 answers
  • A program runs from start to finish, producing unexpected results, though no error message is received. What most likely occurre
    15·1 answer
  • What decides the amount of delay between shots on a digital camera?
    7·1 answer
  • Cuáles eran las condiciones de vida de las mujeres durante el renacimiento perduran​
    14·1 answer
  • While storms could be a cause, power______ are more likely to be caused by disturbances from high-demand equipment in a home or
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!