The correct answer to the question is option D.
A good number of desktop publishers would rather create the text portion of their documents using a word processing program, and then import the text into a desktop publishing file. Thankfully, w<span>ord processing programs are compatible with desktop publishing and other software programs.</span>
Answer:
The above code print the text at three times.
Explanation:
- It is because the above code has one loop which executes three times. The loop executes for the value of i = 0,1 and 10.
- when the value of i is 0 then "++i" will increase the value 1 and the text will be printed.
- If the value of i=1, then the value of i is 2 in the second iteration and the again the text is printed, then the if condition gives the true result and the value of i will be 10.
- Then the loop executes for the last time when the value of i is 10.Then the value will be 11 because of the increment operator and the text will be printed for the third time.
- Then the while loop is not true for the 11 value of i and the loop will get terminated.
Answer:
// program in C++.
#include <bits/stdc++.h>
using namespace std;
// main function
int main()
{
// string array
string m[3];
// array to store rainfall
double rainfall[3];
// variables
double avg_rainfall,sum=0;
for(int i=0;i<3;i++)
{
cout<<"Enter name of month "<<i+1<<" :";
// read month name
cin>>m[i];
cout<<"Enter rainfall (inches) in month "<<i+1<<" :";
// read rainfall
cin>>rainfall[i];
// sum of rainfall
sum+=rainfall[i];
}
// Average rainfall
avg_rainfall=sum/3;
// print Average rainfall
cout<<"Average rainfall for "<<m[0]<<","<<m[1]<<","<<m[2]<<" is "<<avg_rainfall<<" inches."<<endl;
return 0;
}
Explanation:
Create string array "m" to store name of month and double array "rainfall" to store rainfall. Read name of 3 months and rainfall in that month.Find the sum of all the rainfall and the average rainfall.Print the average rainfall of 3 months.
Output:
Enter rainfall (inches) in month 2 :45
Enter name of month 3 :july
Enter rainfall (inches) in month 3 :43
Average rainfall for may,june,july is 42.6667 inches.
Is that the whole question? or