Answer:
Following are the program in C++ language
#include <iostream> // header file
using namespace std; // namespace
int main() // main function
{
int number=0; // variable declaration
while(number>-1) // iterating the while loop
{
cout<<"body"<<endl; // dsiplay the statement
cin>>number; // Read the value by the user
}
cout<<endl<<"Done";// dsiplay the statement
return 0;
}
Output:
body
5
body
45
body
-8
Done
Explanation:
Following are the description of the statement
- Declared a variable "number" of int type and initialized with 0 to them
- iterating the while loop. In this loop print the message "body" and Read the value by the user in the "number" variable. This loop will be executed repeatedly until the user do not read the negative value.
- After the execution of the while loop, it prints the message "Done".