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
PilotLPTM [1.2K]
3 years ago
11

What is the output of the code snippet given below?string s = "abcde";int i = 1;while (i < 5){ cout << s.substr (i, 1);

i++;}a. no outputb. abcdc. abcde d. bcde
Computers and Technology
1 answer:
Ronch [10]3 years ago
4 0

Answer:

The answer is "Option d".

Explanation:

In the given C++ program code, two-variable is defined, that is "s and i", in which variable s is a string type that holds a value, that is "abcde", and variable i is an integer type, that holds a value '1'.

  • In the next line, a while loop is declared, that uses integer variable which value is less than 5, inside a loop a substring function is used, that specifies the number of character and return its value.  
  • In array and string indexing starts from 0, and that variable i starts from 1, that is used in substring function, that's why it will print only "bcde".
You might be interested in
In a spreadsheet, equations that use addition, subtraction, multiplication, and division operators, as well as values and cell r
timama [110]

The equations that uses addition, subtraction, multiplication and division operators and other values in a spread sheet is known as formulas. They are a way of having to provide symbols in means of expressing information regarding a mathematical formula that are being solved or showing its solution along with it.

4 0
3 years ago
How can you insert an image file in your word document?​
Margarita [4]

Click the insert tab, it'll show a pop up window. Go to the location of where your picture may be. Double click on the photo, and it will be inserted into the word document.

6 0
3 years ago
Sets of rules that a computer uses to solve problems?
jonny [76]

Protocal

I need to make this 20 charaters so ye

8 0
3 years ago
Read 2 more answers
Consider the efficiency of locating the kth element in a singly-linked list. How does that compare to locating the kth element i
eimsori [14]

Answer:

Finding kth element is more efficient in a doubly-linked list when compared to a singly-linked list

Explanation:

Assuming that  both lists have firs_t and last_ pointers.

For a singly-linked list ; when locating a kth element, you have iterate through a number of k-1 elements which means that locating an element will be done only in one ( 1 ) direction

For a Doubly-linked list : To locate the Kth element can be done from two ( directions ) i.e. if the Kth element can found either by traversing the number of elements before it or after it . This makes finding the Kth element faster because the shortest route can be taken.

<em>Finding kth element is more efficient in a doubly-linked list when compared to a singly-linked list </em>

4 0
2 years ago
How are the stop lamp bulbs connected in relation to each other? a. In parallel. b. In series. c. In series/parallel. d. None of
laiz [17]

In Parallel option A is true

Because In parallel circuit, the voltage across each components is same and the total current is sum of the currents through each component.

6 0
3 years ago
Other questions:
  • Which individual of the following would be most likely to be directly concerned with web security?
    14·2 answers
  • Write a Java program to print the result in the series 10, 15, 20, 25, ..., 50. Hint: You can use an iteration statement for wri
    9·1 answer
  • Which of the following SQL statements will display all customers who have not recently placed an order? a. SELECT customer# FROM
    15·1 answer
  • Your company received a call from a historical society inquiring about the possibility of networking a two-century-old building
    15·1 answer
  • When an application contains just one version of a method, you can call the method using a(n) ____ of the correct data type.
    6·1 answer
  • You are looking at computer ads. One has a processor that is 3.64GHz. What does this mean?
    5·1 answer
  • Question #5
    14·1 answer
  • Lee has changed the style of his table to make the header row stand out. Next, he wants to center the text in the header row and
    11·2 answers
  • What are five don’ts of using a computer
    8·2 answers
  • To verify a Windows system meets the minimum processor and memory requirements to install software, use the ________.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!