Answer:
// CPP program to find type of input character
#include <iostream>
using namespace std;
void charCheck(char input_char)
{
// CHECKING FOR ALPHABET
if ((input_char >= 65 && input_char <= 90)
|| (input_char >= 97 && input_char <= 122))
cout << " Alphabet ";
// CHECKING FOR DIGITS
else if (input_char >= 48 && input_char <= 57)
cout << " Digit ";
// OTHERWISE SPECIAL CHARACTER
else
cout << " Special Character ";
}
// Driver Code
int main()
{
char input_char = '$';
charCheck(input_char);
return 0;
}
Explanation:
// CPP program to find type of input character
#include <iostream>
using namespace std;
void charCheck(char input_char)
{
// CHECKING FOR ALPHABET
if ((input_char >= 65 && input_char <= 90)
|| (input_char >= 97 && input_char <= 122))
cout << " Alphabet ";
// CHECKING FOR DIGITS
else if (input_char >= 48 && input_char <= 57)
cout << " Digit ";
// OTHERWISE SPECIAL CHARACTER
else
cout << " Special Character ";
}
// Driver Code
int main()
{
char input_char = '$';
charCheck(input_char);
return 0;
}
Answer:
Logical Expressions
Explanation:
The expressions that have logical statements which could be "true or false" are known as logical expressions. These types of expressions are also known as Boolean Expressions.
These expression are used in computer programming. The purpose of these expressions in programming is to make a decision that could be based on different conditions. These conditions could be true or false. This is the main reason that. logical expression makes best sense for values received in true or false.
Answer:
"You passed the test!"
Explanation:
Here user reading grade "test_score" and checking the student score in "If" condition. If it is less than 60 we are printing "You failed the test!" and if it is >60 we are outputting the string "You passed the test!" and else if it not satisfying any of these then we are printing "You need to study for the next test!".As "test_score" value is 90 which is >60 it satisfies the condition >60. So we are printing the string "You passed the test!"