Answer:
Following is given the solution for the question.
Code is attached and all the comments are given to make the code clear.
The output is also attached in the end.
I hope it will help you!
Explanation:
Answer:
3 times
Explanation:
Given
The above loop
Required [Missing from the question]
Times the loop is executed
From the question, we have:
count2 = 0 ----- Start
count2 < 3 ----- End. This means (2) because 2 < 3
coun2++ ----- Increment of 1
This means that count2 will be incremented by 1 from 0 to 2.
So, the values of count2 at each loop is:
count2 = 0, 1, 2
Hence, the loop is executed 3 times
Answer:
I'm about 99% sure it's C: a unique address or location un the collection
Answer:
Check the explanation
Explanation:
C++ code:
#include <bits/stdc++.h>
using namespace std;
string convert(string s){
int l=s.length();
string ans=" hours";
if(l==7){
if(s[5]=='a'||s[5]=='A'){
ans[0]='0';
ans[1]=s[0];
ans[2]=s[2];
ans[3]=s[3];
else{
if(s[6]=='a'||s[6]=='A'){
ans[0]=s[0];
ans[1]=s[1];
ans[2]=s[3];
ans[3]=s[4];
return ans;
}
int main(){
cout<<"Enter time: ";
string s;
getline(cin,s);
cout<<"Corresponding military time is "<<convert(s)<<endl;
return 0;
}