I have problem in getting outputs
plz give me suggetion or correct error if any and make it working.......
plz help.........
there is no error........in this program.........when i compiled.
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdio>
#define IS_STRING 1
#define IS_CHARACTER 2
#define IS_INTEGER 3
#define IS_FLOAT 4
//using std::cout;
//using std::cin;
//using std::endl;
using namespace std;
int main(void)
{
string s;
cout<<"Input a string/character/number:\n";
cin>>s;
short int input_type=0;
int x;
bool DotReached=false;
if(s.length()==1 && (s[0]>'9' || s[0]<'0'))
{
input_type=IS_CHARACTER;
cout<< "its a char";
}
else
for(x=0;x<s.length();x++)
{
if((s[x]>'9' || s[x]<'0') && s[x]!='.')
{
input_type=IS_STRING; break;
cout<<" Its an integer ";
}
else if(s[x]=='.')
{if(!DotReached) DotReached= true; else
{
input_type=IS_STRING;
cout<<"ITs a Float";
break;
}
}
}
cin.get();
cin.get();
return 0;
}