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
Natali5045456 [20]
3 years ago
12

Write a program that asks the user to enter a series of single digit numbers with nothing separating them. Read the input as a C

-string or a string object. The program should display the sum of all the single-digit numbers in the string. For example, if the user enters 2514, the program should display 12, which is the sum of 2, 5, 1, and 4. The program should also display the highest and lowest digits in the string.
Computers and Technology
1 answer:
vladimir2022 [97]3 years ago
4 0

Answer:

#include <stdio.h>

#include <string.h>

int main(){

   char number[100];

   printf("Number: ");

   scanf("%s", number);

   int sum = 0;

   for(int i =0;i<strlen(number);i++){

       sum+= number[i] - '0';

   }

           printf("Sum: %d",sum);

   return 0;

}

Explanation:

This declares a c string of 100 characters

   char number[100];

This prompts user for input

   printf("Number: ");

This gets user input

   scanf("%s", number);

This initializes sum to 0

   int sum = 0;

This iterates through the input string

   for(int i =0;i<strlen(number);i++){

This adds individual digits

       sum+= number[i] - '0';

   }

This prints the calculated sum

           printf("Sum: %d",sum);

   return 0;

You might be interested in
What is a basic operation of computers
ruslelena [56]
What is the context of the question? With all that you have provided my best guess would be "computational function/solving"
8 0
3 years ago
What does =SUM(B2:B6) mean
dedylja [7]

In Excel the sum B2 and B6 simply means that B2 and B6 Numbers are adding to get a Sum, it actually like the normal Calculator, but in Excel it helps to do the calculation of your your data simple and easy, there is no hard work.

8 0
3 years ago
Think about how you view your emails—either the email service you use yourself or an email service you would choose to use. Desc
Assoli18 [71]

Answer:

and POP3, followed in later years. POP3 is still the current version of the protocol, though this is often shortened to just POP. While POP4 has been proposed, it's been dormant for a long time.

IMAP, or Internet Message Access Protocol, was designed in 1986. Instead of simply retrieving emails, it was created to allow remote access to emails stored on a remote server. The current version is IMAP4, though most interfaces don't include the number.

The primary difference is that POP downloads emails from the server for permanent local storage, while IMAP leaves them on the server while caching (temporarily storing) emails locally. In this way, IMAP is effectively a form of cloud storage.

7 0
2 years ago
What is the primary purpose of the software package offered by hyper-v called guest integration services?
zysi [14]

Solution:

Guest integration services resolves compatibility issues of certain guest operating systems experiencing non-functioning features.

Data integration service is the employment of a group of services that comply with service-oriented architecture. Data integration service can perform in an N -> 0 latency time period. At the same time, it offers a powerful set of transformation processes for meeting an array of business imperatives. The advantages of employing data integration as an enterprise service include reduced time for marketing, a reduction in total cost of ownership (TCO), and a solution to the obsolete and expensive data-integration patterns presently available in corporate businesses.

This is the required answer.

6 0
3 years ago
David is working in a database that organizes student exam grade information. He needs to find all students who have scored 100
kobusy [5.1K]

Answer:

David can apply filter to the data in order to show only records that meet the criteria.

Explanation:

  • Filter is a very helpful option that displays the records that you want to view, hiding rest of the unwanted records.
  • Sometimes you want to extract and view only the records that match a specific criteria instead of viewing all the records.
  • For example in the CUSTOMERS table which contains names, addresses, countries of customers. There are several customers from different countries but you only want to view the customers from Spain. So you can use filter feature to view all the customers from country Spain.
  • In MS Access you can apply filters using Sort & Filter group in the Home tab by selecting the desired column. In SQL, WHERE clause can be used along with SELECT to for filtering and extracting certain records. SELECT will select the records from the table and WHERE clause will specify the criteria to select the certain records.
7 0
3 years ago
Other questions:
  • Whats a computer scientist.
    5·2 answers
  • When assembling a desktop computer you should always install the drives before the motherboard?
    9·1 answer
  • Which statement about images is correct? A) A virtual image cannot be formed on a screen. B) A virtual image cannot be viewed by
    12·1 answer
  • A standard for compressing music into computer files that can be easily exchanged on the Internet is called a(n) ______. A. musi
    5·1 answer
  • You insert a comment in a worksheet by using a command on the ____ tab on the Ribbon.
    13·1 answer
  • Help me or I'll go insane I've 6x already I'm about to lose it!!!!
    11·2 answers
  • The biggest limitation of a network operating system (NOS) is _____ in terms of memory, process, device, and file management.
    7·1 answer
  • Caroline is building an expert system for wartime defense. Which of these is true about the system she is building?
    14·1 answer
  • The term packet is used fairly generically to refer to protocol data unit (PDU). There are PDU equivalent names in the different
    15·1 answer
  • Requests to retrieve data written in a language such as SQL are called…
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!