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
Alenkasestr [34]
3 years ago
8

Count input length without spaces, periods, or commas Given a line of text as input, output the number of characters excluding s

paces, periods, or commas. You may assume that the input string will not exceed 50 characters.
Ex: If the input is:
Listen, Mr. Jones, calm down.
the output is:
21
Note: Account for all characters that aren't spaces, periods, or commas (Ex: "r", "2", "!").
Can I get this in C programming please?
Computers and Technology
2 answers:
MrRa [10]3 years ago
6 0

Answer:

This program is implemented in C++ using dev C++.  The solution of this answer along with running code is given below in explanation section.

Explanation:

#include <iostream>

#include<string>

using namespace std;

int main()

{

   string str;

   

cout<<"Enter String \n";

 

getline(cin,str);/* getLine() function get the complete lines, however, if you are getting string without this function, you may lose date after space*/

 

   //cin>>str;

 

   int count = 0;// count the number of characeter

   for (int i = 1; i <= str.size(); i++)//go through one by one character

   {

     

   

    if ((str[i]!=32)&&(str[i]!=44)&&(str[i]!=46))//do not count  period, comma or space

 {

           ++ count;//count the number of character

       }

   }

   cout << "Number of characters are  = "; //display

cout << count;// total number of character in string.

   return 0;

}

}

Ivanshal [37]3 years ago
5 0

Answer:

user_text = input()

import re

string = ( "listen, Mr. Jones, calm down.")

print(len(re.sub(r'[,.\s]+', '', string)))

Explanation:

You might be interested in
Any executable files???
Kipish [7]

Doesn't look like there are any..

7 0
2 years ago
A(n) __________ DHCPv6 server relies on router advertisements to give some information to individual hosts, making small changes
vodomira [7]

Answer:

Stateless

Explanation:

According to my experience in the field of information technology and networking, I can say that the type of server being mentioned is a Stateless DHCPv6 server. This is a server that provides some information to individual hosts within the network, but does not make any address assignments to the individual devices. Like mentioned in the question.

8 0
2 years ago
Define a function group-by-nondecreasing, which takes in a stream of numbers and outputs a stream of lists, which overall has th
Debora [2.8K]

Answer:

def group_by_nondecreasing( *args ) :

     num_list = [arg for arg in args]

     sorted_numlist = sorted( num_list )

     list_stream = [ sorted_numlist, sorted_numlist, sorted_numlist ]

     return list_stream

Explanation:

This python function has the ability to accept multiple and varying amount of arguments. the list comprehension shorten the logical for statement to generate a list of numbers, sorts the list in ascending order by default and duplicates the list in another list.

5 0
3 years ago
Which of the following restricts the ability for individuals to reveal information present in some part of the database?
Anni [7]

Answer:

it would have to be flow control which would be C.

Explanation:

8 0
2 years ago
A user from the accounting department has contacted you regarding problems with a dot matrix printer. When you examine the outpu
Mama L [17]

Answer:

Replace the printhead is the correct answer.

Explanation:

Because in the following statement, that person is from the department of the accounting then, he call the technician regarding the problem occurs in the printer which is dot-matrix printer and when he examined the dot-matrix printer and replace the printhead because when he print any document then, he finds that some letters have missing from the page.

5 0
3 years ago
Other questions:
  • What does the Flippy Do Pro show about representing very small numbers?
    13·1 answer
  • What is the range of the well-known ports used by tcp and udp?
    5·1 answer
  • In what stage of writing does publishing occur
    14·1 answer
  • What port does rdp use by default and from what range of numbers should you select a private port number?
    15·1 answer
  • What is the standard internet protocol, which provides the technical foundation for the public internet?
    9·1 answer
  • While you are working on your computer, it shuts down unexpectedly, and you detect a burning smell. When you remove the case cov
    9·1 answer
  • What is a protein called if it loses its shape?
    8·1 answer
  • Deleting anitem from a linked list is best when performed using two pointersso that the deleted item is freed from memory.
    7·1 answer
  • HW2.24. Statement: Area of a Triangle The area of a triangle can be computed by knowing the base and height of the triangle usin
    11·1 answer
  • Frequently used _____________ can be saved as _____________ for use in analysis, dashboards, reports, tickets, and alerts.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!