you can take the input as a string and use the logic given by cire
#include<iostream.h>
int main()
{
char s[10];
cout<<"enter the decimal number";
cin>>s;
cout<<"whole part is:";
for(int i=0;s[i]!='.';i++)
cout<<s[i];
cout<<"decimal part is:";
while(s[i]!='\0')
{
cout<<s[i];
i++;
}
return 0;
}