Light Amplification by Stimulated Emission of Radiation
Answer:
The answer is "The program can also be expressed as a binary code, but it is easier for people to understand when it is expressed in a higher programming language".
Explanation:
In the given question some details are missing that is options of the question that can be given as follows:
A. The program can also be expressed as a binary code, but it is easier for people to understand when it is expressed in a higher programming language.
B. The program can also be represented as a binary code that reduces the likelihood of errors.
C. Binary code can not be used for binary code, because binary code can only represent data.
D. Some parts of the program, however, should be printed in a higher-level language for the operation.
The computer knows the only binary language, It is a form of 0 and 1, but this language can't be understood by the user. It will convert into high-level language, that is understood by the user, that's why this option is correct. In which accepts of option A, all options are wrong that can be described as follows:
- In option B, It is wrong, because the user may not understand binary language, and he can also be writing some wrong code that is converted in binary code, that will increase error.
- In option C and option D, is incorrect because all the data that is stored in the computer is in the form of binary code.
Answer:
// program in C++.
#include <bits/stdc++.h>
using namespace std;
// main function
int main()
{
// variable
int inp_month;
cout<<"Enter month:";
// read month
cin>>inp_month;
// if month is february
if(inp_month==2)
cout<<"Number of days in month:28"<<endl;
// if month is 4 or 6 or 9 or 11
else if(inp_month==4||inp_month==6||inp_month==9||inp_month==11)
cout<<"Number of days in month:30"<<endl;
else
// for others month
cout<<"Number of days in month:31"<<endl;
return 0;
}
Explanation:
Read month from user and assign it to variable "inp_month".If month is 2 then there is 28 days in the month.If input month is 4 or 6 or 9 or 11 then there is 30 days in the month.For other month there will be 31 days in month.We assume there is no leap year.
Output:
Enter month:4
Number of days in month:30