Answer:
The correct code to the given question is
if ((counter % 10) == 0) // check the condition
{
System.out.println("Counter is divisible by ten: " + counter); // display
}
else // check the condition
{
System.out.println("Counter is not divisible by ten: " +counter); // display the //value
}
counter++; // increment the value of counter
Explanation:
Following are the description of code
- In the given question we have to check the condition that the given number is divisible by 10 or not .
- In the if block if the number is divisible by 10 then it print the value of number and increment the value of counter .
- In the else block if the number is not divisible by 10 then it print the value of number and increment the value of counter .
- It means the value of counter is increases in the if block as well as in the else block .So we have to remove the counter statement from there and place outside the if and else block .
Answer:
I don't know
Explanation:
please just thank me I need the points
Answer:
Explanation:
Before answering this question we need to first know the differences between System Mode and User Mode.
System Mode mainly runs code and at the same time overlooking the user's privileges and permissions.
the attribute(s) that belongs to the user model includes:
User Mode
- User programs typically execute in this mode
- Less-privilege mode
while the attribute(s) that belongs to the system model includes:
System Mode
- Also referred to as control mode or kernel mode
- Kernel of the operating system
- More-privilege mode
Answer:
#include <iostream>
using namespace std;
int main()
{
int day;
cout<<"Enter a number for the day of the week"<<endl;
cin>> day;
switch (day) {
case 1: cout << "Monday"<< endl; break;
case 2: cout << "Tuesday" << endl; break;
case 3: cout << "Wednesday" << endl; break;
case 4: cout << "Thursday" << endl; break;
case 5: cout << "Friday" << endl; break;
case 6: cout << "Saturday" << endl; break;
case 7: cout << "Sunday" << endl; break;
default: cout<<"Error, You entered an invalid day"<<endl;
}
return 0;
}
Explanation:
The program is written using a switch statement in C++ programming language. we start off by creating a variable day of type integer, which is received using the cin statement. We then use switch statement to test the value using the conditions stated in the question. We use the default statement which acts like an else statement to handle the an invalid situation