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
Anwser the question below plz due in 15 mins.
klemol [59]
Novels about Harry Potter, a boy who learns on his eleventh birthday that he is the orphaned son of two powerful wizards and possesses unique magical powers of his own. He is summoned from his life as an unwanted child to become a student … More
Releas
6 0
3 years ago
5.18 LAB: Output numbers in reverse Write a program that reads a list of integers, and outputs those integers in reverse. The in
Rina8888 [55]

Answer:

In C++:

#include<iostream>

#include<vector>

using namespace std;

int main(){

   int len, num;

   vector<int> vect;

   cout<<"Length: ";

   cin>>len;  

   for(int i = 0; i<len;i++){

       cin>>num;

   vect.push_back(num);}

   vector<int>::iterator iter;

   for (iter = vect.end() - 1; iter >= vect.begin(); iter--){

       cout << *iter << ", ";}    

}

Explanation:

This declares the length of vector and input number as integer

   int len, num;

This declares an integer vector

   vector<int> vect;

This prompts the user for length  

cout<<"Length: ";

This gets the input for length  

   cin>>len;  

The following iteration gets input into the vector

<em>    for(int i = 0; i<len;i++){</em>

<em>        cin>>num;</em>

<em>    vect.push_back(num);}</em>

This declares an iterator for the vector

   vector<int>::iterator iter;

The following iterates from the end to the beginning and prints the vector in reverse

<em>    for (iter = vect.end() - 1; iter >= vect.begin(); iter--){</em>

<em>        cout << *iter << ", ";}</em>

<em />

<em />

6 0
3 years ago
Select the correct answer.
siniylev [52]

Answer:A

Explanation: J pegs are easily saved and accessed anywhere and show good quality

8 0
3 years ago
Which of the following is not a recommended method to protect you from identity theft?
yaroslaw [1]

Answer:

post them, but id say anything with personal information

7 0
3 years ago
What is the core function of an enterprise platform
7nadin3 [17]

Answer:

The core function of an enterprise platform is that it connects the supplier with the consumer

4 0
2 years ago
Other questions:
  • Write an expression using a variable that shows how much 3 pairs of jeans will cost if you do not know the price of the jeans.as
    7·1 answer
  • When you receive five job offers what does it mean
    9·1 answer
  • Which of the following tasks would you most likely use a spreadsheet to complete
    15·1 answer
  • The user can set their own computer hostname and username. Which stage of the hardware lifecycle does this scenario belong to?
    6·1 answer
  • Question 1 :George, a user, is having trouble connecting to network resources, including shared folders on the local network and
    7·1 answer
  • Using the _______ list, you can select the number of photos that will appear on each slide.
    10·2 answers
  • These icons cannot be removed from the Dock. Finder e-mail music player Trash
    14·1 answer
  • 8.7 lesson practice question 1
    13·1 answer
  • What is the difference between word processing software and presentation software​
    9·1 answer
  • If you were creating a program that would convert Fahrenheit to Celsius, which kind of variable would you want to use? a string
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!