0

Ok, so basically I want a program which can determine if what the user typed in is a number between 0-9, a letter or a symbol. The commands I have to make it with are:

#include<iostream>
#include<iomanip> 
setw(#) 
setfill('ch') 
bool 
char 
int 
double 
string 
#include<string> 
#include<cmath> 
#include<windows.h> → directiva utilizada para poder el comando de ::Sleep()
::Sleep(#) 
n.length() 


IF/ELSE

(t)x - changes the type of variable
SWITCH

FOR

WHILE

DO/WHILE

This is the only thing i got so far sadly, I have no idea how to continue only using those commands:

#include <iostream>
#include <iomanip>
#include <windows.h>
#include <string>
using namespace std;

int main()
{
    char variable;
    
    cout << "Enter a letter, symbol or number between 0-9: ";
    cin >> variable;
    cout << endl;
    
    if(( variable >= '0') && (variable <= '9'))
    {
         cout << "You have entered: #" << variable << endl << endl;
    }
    
    (  
    
    system("pause");
    return 0;
}

Edited by Kron: n/a

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by NathanOliver
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.