Can someone help me with these problems? the coding language is C++ 7-3 461 Fne
ID: 3678946 • Letter: C
Question
Can someone help me with these problems? the coding language is C++
Explanation / Answer
7. a.
switch(value % 2)
{
case 0: cout << "Even" << endl; break;
case 1: cout << "Odd" << endl; break;
}
b.
for(int i = 19; i >= 1; i -= 2)
cout << i << endl;
c.
int count = 2;
do
{
cout << count << endl;
count += 2;
} while(count <= 100);
8.
ifstream input;
input.open(''myData.txt");
if(input.is_open())
cout << "File successfully opened.";
ofstream output;
output.open("myDataOut.txt");
If you need any refinements, just get back to me.