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
T is important to remember to print the return address when printing an
expeople1 [14]
Shipping label? Ggggggggggggg
6 0
3 years ago
What is the big-O performance estimate of the following function?
larisa [96]

Answer:

The time complexity of the code is O(log₇n).

Explanation:

The i is updated by 7*i.On each iteration i is multiplied by 7.So on finding the time complexity of the code given above it will come out to  be log base 7.

When we divide the input by 2 the time complexity is log base 2.

So on dividing it by 7 we get the time complexity of log base 7.

8 0
3 years ago
Read 2 more answers
A deleted file or folder is not permanently deleted from a computer until which event occurs?
Dimas [21]

Answer:

The computer is restarted. The Recycle Bin or Trash is emptied

Explanation:

8 0
2 years ago
What is the value of the variable phones after the execution of the following code? phones = {'John': '5555555', 'Julie' : '7777
uysha [10]

Answer:

phones = {'John': '1234567', 'Julie' : '7777777'}

Explanation:

In the code given in the question phones dictionary contains contains two keys John and Julie and have the values '5555555' and '7777777' respectively. Now in the code the key John in the dictionary phones is assigned the value '1234567' .So the value corresponding to the key John becomes '1234567'.

3 0
3 years ago
you'll be organizing the various databases in your organization, and have recommended hiring a/an?A. internet specialist B. comp
jek_recluse [69]
Either c or d, most probably D
7 0
3 years ago
Read 2 more answers
Other questions:
  • Write a C program that reads a string containing text and nonnegative numbers from the user and prints out the numbers contained
    6·1 answer
  • Approximately what percent of desktop PCs are used for work-related purposes?
    12·1 answer
  • What is the safest way to shut down a desktop or laptop computer?
    8·1 answer
  • Which of the following sets of acronyms is concerned with encoding data for secure transmission?
    11·1 answer
  • What is it called to persist in trying to multitask can result in this; the scattering bits of one’s attention among a number of
    9·1 answer
  • Assume the existence of an UNSORTED ARRAY of n characters. You are to trace the CS111Sort algorithm (as described here) to reord
    14·1 answer
  • You’ve found the file you’ll be working with. Next, you decide to move
    13·1 answer
  • 1. What is hydrolics?​
    6·1 answer
  • To what extent do you agree with the assertion that “Collection development begins with community analysis”. (Give reasons to bu
    7·1 answer
  • A pseudo code that asks the user for their forename and their surname , and then outputs both, separated by a space to the user​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!