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
Nadusha1986 [10]
3 years ago
11

Write a program "addnumbers.c" where it takes as many arguments as the user includes as command line arguments and calculates th

e sum of all numbers entered, and prints it. You will find using function atoi() from stdlib.h library helpful, where it converts the string representation of an integral number to an int value. Compile it on a lab machine and run it using command line.

Computers and Technology
1 answer:
gogolik [260]3 years ago
8 0

Answer:

#include <stdio.h>

#include <stdlib.h>

int main(int argc, char* argv[])

{

int first, second, total;

if (argc < 2)//checking if there are enough arguments

{

 printf("not enough values\n");

 return -1;//terminate program

}

total = 0;

for (int i = 1; i < argc; i++)

{

 //atoi convert a string into int. doing this to use operator

 total = total + atoi(argv[i]);//add current total to next argumment

}

printf("final total sum: %d\n", total);//printing final total

return 0;

}

Explanation:

For command line arguments you have to use command prompt. It varies depending on you machine and where you code is placed.

So, go to command line, called "command prompt" on Windows. This should open the black screen, also called the Terminal. A picture is attached in the answer. Then you have to NAVIGATE to the directory of your program. So, let's say your code is on your desktop. You will have to navigate to your desktop. To do this, type:

"cd Desktop", and press enter.

The picture of my process is attached below too.

Then, the program we have made is called addnumbers. we will type,

"addnumbers 10 20 30 40 50"

add numbers is the name of the program followed by arguments, separated with spaces.

You might be interested in
What are techniques for active listening? Select all
erastova [34]

Answer:

asking clarifying questions, without interruption

6 0
3 years ago
Using web-safe fonts and colors is something you can do to increase blank
Lostsunrise [7]

Using web-safe fonts and colors is something you can do to increase user experience and reliability when creating a web app by ensuring compatibility.

<h3>What are web-safe fonts and colors?</h3>
  • Fonts and colors are considered web-safe when they are included in the basic installation of web browsers.
  • What this means is that these fonts and colors come preinstalled in browsers.
  • This ensured compatibility leads to increased reliability.
  • Having a reliable web app improves user experience and makes for a more successful application.

Therefore, given that web-safe fonts and colors are just those that come preinstalled in most web browsers, using these during the development of your web app will ensure that most users will not have any issues. This increases reliability and improves the user experience.

To learn more about web fonts visit:

brainly.com/question/14450275?referrer=searchResults

7 0
3 years ago
Tysm for Ace! :O<br> Hurray!
professor190 [17]

Answer:

Good job!! You deserve it.

Explanation:

3 0
3 years ago
Read 2 more answers
Describe how web caching can reduced the delay in receiving a requested object .Will web caching reduce the delay for all object
nydimaria [60]

Answer:

Web caching can bring the desired content "closer" to the user, perhaps to the same LAN to which the user's host is connected. Web caching can reduce the delay for all objects, even objects that are not cached, since caching reduces the traffic on links

Explanation:

8 0
3 years ago
A blue compressor clutch indicates that it's been slipping due to too
SVETLANKA909090 [29]

Answer:

Hi,

This effect can be due to <u>dull/ unpolished clutch c</u>aused by incorrect amount of oil in the system

Explanation:

Clutch is the third highest failures observed in AC after hose leaks and compressors.Some of the clutch related failures are bearing failure, burnt coil, unbalanced motor to air hub gap, noisy bearing ,and unpolished clutch.Burnishing of a clutch is when the wearing  of the engagement surface if the clutch is allowed to increase the starting torque.The effect of dull clutch is that it produces low staring torque making it to slip and fail.When too much oil is applied, it will cause the compressor to slug and the clutch to slip.Low amounts of oil will cause the compressor to bind and the clutch to slip because of increased discharge pressures in the system.

Best of Luck!

6 0
4 years ago
Other questions:
  • When a structure satisfies all the properties of a relation except for the first item—in other words, some entries contain repea
    7·1 answer
  • Energy is defined as stored energy
    13·2 answers
  • 10^4+10-2=<br>10^4+10-2=
    12·2 answers
  • ​the complete definition of a database, including descriptions of all fields, tables, and relationships, is called a _____.
    7·1 answer
  • A bug was discovered in Canvas where the website crashes if 2 or more students are writing a discussion post at the same time. I
    10·1 answer
  • In computer Drag and Drop“ means to select the items, hold down the mouse and
    15·1 answer
  • How do you respond to an email?
    6·1 answer
  • What output is produced by
    10·1 answer
  • I’m gonna ask this again because I REALLY need an answer.
    10·2 answers
  • I am a non-volatile type of built-in memory. I store my contents long-term. My job is to store critical programs that the comput
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!