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
What is the full form of EPROM (CLASS-6)
vodomira [7]

Answer:

earth planet rest orbit moon

4 0
2 years ago
Read 2 more answers
Which shape denotes a process to be carried out in a flowchart?
luda_lava [24]

The answer is a rectangle.

6 0
3 years ago
Read 2 more answers
What is SEO and SEM?
velikii [3]

Answer:

SEO stands for “search engine optimization.” In simple terms, it means the process of improving your site to increase its visibility for relevant searches.

SEM, or search engine marketing, is the act of using paid strategies to increase search visibility.

4 0
2 years ago
What are the uses of computer in educational setting?
Arada [10]

Answer:

Quick Communication & Correspondence

Explanation:

Another main advantage of using computers in the education field is the improvement in the quality of teaching-learning process and communication between students & teachers. For this, they use Microsoft PowerPoint to prepare electronic presentations about their lectures.

8 0
3 years ago
Read 2 more answers
Jenny needs to record the names of 30 students, write down the subjects they studied, and note their grades in each subject afte
SCORPION-xisa [38]

Changing a worksheet name in Microsoft Excel can be done in multiple ways, but only one of them is correctly explained in the provided option, which is (A) double-click both the worksheet tabs one at a time and then enter the new names.

The other options are incorrect. Even though you can change a worksheet’s name by right-clicking the sheet name, you also need to choose the appropriate option from the window bar that would appear – which is, of course, the rename option.

5 0
3 years ago
Read 2 more answers
Other questions:
  • Consider the following classes:
    8·1 answer
  • A motherboard uses dual channeling, but you have four DIMMs available that differ in size. The motherboard supports all four siz
    7·1 answer
  • Which of the following is the strongest password? Xo795&amp;A &amp;cGo9Tz F5h#3u9g vU7#$3T sC9$d&amp;cF5h#3u9g
    13·2 answers
  • Write a function SwapArrayEnds() that swaps the first and last elements of the function's array parameter. Ex: sortArray = {10,
    8·1 answer
  • How do you make your graphics ADA accessible in BlueGriffon?
    12·2 answers
  • Create an application named TurningDemo that creates instances of four classes: Page, Corner, Pancake, and Leaf. Create an inter
    7·1 answer
  • HELP ME PLEASE ASAP
    6·1 answer
  • I have no idea how to use the sep and end in Python can someone help me I have a test tomorrow
    13·1 answer
  • Jeroo Bob has just awoken from a long night's sleep and is hungry for some winsum flowers. He walks out of
    7·1 answer
  • Question 2 of 10
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!