he whole thing starts about twelve, fourteen or sev include include include sing namespace std; nt main()
Types of Loop
Loops are the elements of programming in which a part of code is repeated a particular number of times. Loop executes the series of statements many times till the conditional statement becomes false.
Loops
Any task which is repeated more than one time is called a loop. Basically, loops can be divided into three types as while, do-while and for loop. There are so many programming languages like C, C++, JAVA, PYTHON, and many more where looping statements can be used for repetitive execution.
While Loop
Loop is a feature in the programming language. It helps us to execute a set of instructions regularly. The block of code executes until some conditions provided within that Loop are true.
c++
![1. Suppose the file mystery.txt contains the text below:
The whole thing starts about twelve, fourteen or seventeen.
#include
<iostream>
#include
<fstream>
#include <string>
using namespace std;
int main()
string word;
i
int
0;
ifstream read("mystery.txt");
while(!read.eof ()){
read>>word;
if(i < word.length())
cout<<word[i];
i++;
}
cout<< endl;
what will be printed into the screen after the program runs
seventeen
Thirteen
O fourteen
O twelve](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F33eba9e5-eb7d-44a1-93e3-ed0ee897e17f%2F631b2257-bfb3-4216-b1a8-0dce2a5455fc%2Fqp7bg7_processed.png&w=3840&q=75)

Lets see the solution.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps









