Hi frds,
As i am getting an input value of integer (for ex: 1.413) and i want to limit the number of characters in the input value to 5
for ex:
1.413
14.13
141.3
the ouput
Enter the new value of displacement:_ _ _ _ _
it shud not accept the input more than 5 characters
if it is a string i can limit by using length () or size() function
i cant convert them as a string and use it further
wat can i do?
As i am getting an input value of integer (for ex: 1.413) and i want to limit the number of characters in the input value to 5
for ex:
1.413
14.13
141.3
Code:
double y; cout<<"Enter the new value of displacement: "; cin>>y;
the ouput
Enter the new value of displacement:_ _ _ _ _
it shud not accept the input more than 5 characters
if it is a string i can limit by using length () or size() function
i cant convert them as a string and use it further
wat can i do?
Comment