I used the below code to store an phone number(10 digit number) in c++:
#include<iostream.h>
void main(){
long long num;
cin>>num;
cout<<num;
}
Input:998578985
output:1395855233
Why is this happening? Is there any other way to store a 10 digit number. I am using turboc++ in win7.

I would recommend downloading Visual C++ 2010 Express which is free and a huge improvement over TurboC++. Most of the issues you’re having is due to it being old and no where near standard compliant. For example, it doesn’t have
using(which means you have to qualify things likestd::cin) and doesn’t support C++ header files without the .h.As for your original question: I would just store phone numbers in a string and only try to parse or validate them if I really had to. See this question for an example of parsing using regexes.