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
jolli1 [7]
3 years ago
7

Write a program that reads a series of strings andprints only those strings beginning with the letter "b."

Computers and Technology
1 answer:
coldgirl [10]3 years ago
6 0

Answer:

#include <iostream>

using namespace std;

int main()

{

char str[100][20];

int n;

cout<<"Strings you want to enter"<<endl;

cin>>n;

cout<<"enter n strings"<<endl;

for(int i=0;i<n;i++)

cin>>str[i];

for(int i=0;i<n;i++)

{

if((int)str[i][0]==98) //ascii value b is 98

cout<<str[i]<<endl;

}

return 0;

}

Explanation:

The above written code is for printing the strings which starts with the letter b.

To check if the string starts with a letter b we are checking the ascii value 98 which corresponds to b and then printing those strings.

You might be interested in
1.<br> Which of the following is NOT caused by alcohol?
Alla [95]

Answer:

What are the choices

7 0
3 years ago
Read 2 more answers
Does two core processors mean that it is twice as fast do you agree? why?
vlabodo [156]

Answer:

the friendships the following link and fill out our related information

Explanation:

consisting of a new one of the cell number of people who want

3 0
2 years ago
Package Newton’s method for approximating square roots (Case Study: Approximating Square Roots) in a function named newton. This
Shtirlitz [24]

Answer:

def newton(n):

       #Define the variables.

       t = 0.000001

       esti = 1.0

       #Calculate the square root

       #using newton method.

       while True:

               esti = (esti + n / esti) / 2

               dif = abs(n - esti ** 2)

               if dif <= t:

                       break

   

       #Return the result.

       return esti

#Define the main function.

def main():

   

       #Continue until user press enters.

       while True:

               try:

         

                       #Prompt the user for input.

                       n = int(input("Enter a number (Press Enter to stop):"))

                       #display the results.

                       print("newton = %0.15f" % newton(n))

     

               except:

                       return

#Call the main function.

main()

7 0
3 years ago
Which of these is one of the primary concerns for protecting your family when online?
Lady_Fox [76]
Sharing personal information
7 0
3 years ago
Read 2 more answers
How to order reference list in apa format?
Brums [2.3K]
<span>Title. Label this page References, centered in plain text.Spacing. Make sure to double space throughout.Order. List the sources in alphabetical order by the authors' last names. ...<span>Indentation. Do not indent the first line in the citation; however, you must indent any additional lines 5 spaces in the citation.</span></span>
5 0
3 years ago
Other questions:
  • When you begin typing text, the _________________________ appears on the status bar with an animated pencil writing on paper tha
    15·1 answer
  • Greg works for an online games development company. He is not a net freak, but occasionally he visits online literature sites an
    7·1 answer
  • Which term describes the process by which light passes through an object or a medium.
    7·2 answers
  • Smart art can be used to create _____that highlights relationships betweeen two items
    8·2 answers
  • Press the _______ key to move to the next cell in a row.
    5·1 answer
  • Does anyone know what anotmy means​
    8·2 answers
  • (PYTHON) Write a program that uses this technique to read a CSV file such as the one given above. Display the IDs and names of t
    14·1 answer
  • Select the layer of the OSI model that is responsible for reformatting, compressing, and/or encrypting data in a way that the ap
    14·1 answer
  • Misperceptions can lead to miscommunication. List an example from the article.(site 1)
    10·2 answers
  • Explain the reason why vector graphics are highly recommended for logo​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!