1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
klio [65]
3 years ago
5

Write a C program to input a character, then check if the input

Computers and Technology
1 answer:
rodikova [14]3 years ago
6 0

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;

}

You might be interested in
Whats the next lyric,i baked you a pie,pie,pie
eduard
“oh boy what flavor”
4 0
3 years ago
Read 2 more answers
After a conditional formatting rule is created using the ____ dialog box, the rule is then available for use in the database fro
Setler [38]

Answer:

New Formatting Rule.

Explanation:

Using New Formatting Rule the rule can be used in the database .Conditional formatting is used to highlight cells with different color according to the value of the cell. Conditional formatting can be done using formulas.In conditional formatting you can use if statements ,if else staements ,formulas etc.

5 0
3 years ago
Why might a variable used for output have to be of a different type then a variable used for input?​
telo118 [61]

Answer:

You may use a different variable type for input in order to process the data appropriately and may use a different variable type to accommodate your program.

Explanation:

Your input may have to be different then output varying on what data you are processing.

For example, just like the last question you asked about calculating the area of the rectangle, your input MUST be converted to a different a numerical data type (i.e int or float) in order to do the math.

Based on your last question, if we didn't convert your input into a string your results wouldn't add the numbers together but only concatenate them. If I typed 3 & 5 as length & width, I would get 35 instead of 15.

Now another example is using functions (or methods whatever you want to call them), your input can be one thing and outputs another.

Let's say I want a function to tell me if I am smart. The way I want it to determine if its smart is by inputting my GPA into it, which is a numerical value. So the function would look something like this:

<u>Code (Python)</u>

def IsSmart(gpa):

  if (gpa >= 4):

       return True

  else

       return False

As you can see I am inputting a numerical value and it is outputting a boolean value. I can use this in a if else chain to spit out an output to the user.

7 0
3 years ago
Explain the derived data types in C language with examples each
IRISSAK [1]

Answer:

Array, pointers, struct, and union are the derived data types.

7 0
3 years ago
How do you know when energy is moving in a lightbulb circuit?
vagabundo [1.1K]
When energy flows in the Electric Circuit then Light bulb blows and emits light energy and thermal energy. By that sign, we can get an idea that energy is flowing.

Hope this helps!
4 0
3 years ago
Other questions:
  • As the driver it is not your responsibility that you are focused on the driving task with any possible distractions minimized. T
    9·2 answers
  • write a c++program that allows the user to enter the last names of fivecandidates in a local election and the number of votes re
    15·1 answer
  • Two powerboats are about to cross paths. what should the boat on the starboard (right) do?
    11·1 answer
  • In a proper webpage, which tag holds all of a webpages visble HTML
    12·2 answers
  • Which director has shot a movie in HD? George Lucas, Michael Mann, Michael Moore, none of the above, all of the above
    14·1 answer
  • Technician A says that if you add pre-lube to a sealing lip of an axle seal, it will cause the seal to leak causing the bearings
    8·1 answer
  • Describe the pace of change in ICT
    15·1 answer
  • Freeeee BRAINLIESTHBJHBJHB
    8·2 answers
  • Paul is a baker who wants to improve his recipe for muffins because they turn out with a greasy flavor. What ingredient should h
    14·1 answer
  • Write a 2 paragraph on an African American who has become successful in IT. Need help asap can’t think of anything
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!