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
………………….... controls the operations like reading data from input devices, transmitting information to output devices and checkin
katrin [286]

Explanation:

hi the IP address of my colleague of mine that

6 0
3 years ago
Which of the following creates a new table called 'game_scores' with 2 columns 'player_name' and 'player_score'?
DerKrebs [107]

Answer:

e

Explanation:

the valid sql syntax for creating table is

CREATE TABLE table_name (

column_name column_type

)

varchar and int are the valid sql types not string and integer

AS is used in select queries to aggregate results under given name

8 0
3 years ago
Q. 2. What will be the output of the following code?<br> //printf("Hello\n");<br> printf("Girls");
loris [4]

Answer:

Just two outputs \n a line break so:

Hello

Girls

4 0
3 years ago
A software engineer with a detail oriented personality has the patience and aptitude for
AnnZ [28]

Answer is: looking through many lines of code for errors that cause bugs



Explanation:

A software engineer with a detail oriented personality has the patience and aptitude for  looking through many lines of code for errors that cause bugs


Because software writes many lines of code for developing different application so he has to go through through many lines of code for errors that causes a bug or errors.

I hope you got the idea and answer thanks.

5 0
3 years ago
8
EleoNora [17]

Answer:

yes you are correct

the AND operator narrows

the OR operator broadens your search results

8 0
3 years ago
Other questions:
  • As of 2012, Twitter has approximately how many members?
    10·1 answer
  • What are 3 things that can make cyberbullying especially harmful​
    12·1 answer
  • A (blank) is a special row in an Excel table that provides a selection of
    12·1 answer
  • Fundamental types of data, such as strings, integers, and real numbers, are known as
    5·1 answer
  • Your project must satisfy the following requirements:
    7·1 answer
  • What is the name of the place where students access all of their course information? Student handbook. Learning management syste
    15·1 answer
  • Companies use virtualization to do all of the following except:
    10·1 answer
  • What would the internet be like today if there was no World Wide Web?
    9·1 answer
  • Write an algorithm and flowchart to display H.C.F and L.C.M of given to numbers.​
    9·1 answer
  • NWhen you measure a person’s weight, you are measuring the
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!