Answer:
The following are the solution to this question:
Step-by-step explanation:
In the given question multiple questions have been asked about, that is defined as follows:
#include<iostream>//defining header file
using namespace std;
int main()//defining main method
{
double x1;//defining double variable
cout<<"enter value: ";//print message
cin>>x1;//input value from the user-end
if(x1>0 && x1<=1)//use boolean operators
{
cout<<"x is between zero and one";//print message
}
return 0;
}
Output:
enter value: 1
x is between zero and one
5)
public class Main//defining a class main
{
public static void main(String[] args) //defining main method
{
boolean AA = true; //defining boolean variable
boolean BB = false;//defining boolean variable
boolean CC = true; //defining boolean variable
if ((AA && BB) || (AA && CC)) //defining if block to check value
{
System.out.println("True");//print message
}
if ((AA || !BB) && (!AA || CC))//defining if block to check value
{
System.out.println("True");//print message
}
}
}
Output:
True
True
6)
#include <stdio.h>//defining header file
int main()//defining main method
{
int x;
printf("Enter a value: ");
scanf("%d", &x);
if (x%2==0)// check number
{
printf("Even number");//print message
}
else
{
printf("Odd Number");//print message
}
return 0;
}
Output:
Enter a value: 22
Even number
7)
The answer is "Option C".
In the first question, a double variable "x1" is defined that inputs the value from the user end and use the boolean operators to check the value and print its value.
In question 5, three boolean variables "AA, BB, and CC" are defined that hold boolean value and use if block to check the given value.
In question 6, an integer variable has defined, that input the value and use if block to check even or odd number and print its value.
In question 7, option c is correct.