I want to write a program which take three float input from user and break if user enters an alphabet.kindly help me.i m doing it somthing like this but it isn't working
I want to write a program which take three float input from user
I presume a, b, and c are floats? isalpha works only for characters.
break if user enters an alphabet
If youser will enter an alphabetic character instead of floating point number, input will already breaks. You will have to detect this and recover from it, or all other input will fail too. read this: http://www.parashift.com/c++-faq/istream-and-ignore.html
if a,b,c are declared floats then all you need to do is check there wasn't an error during input.
replace !isalpha(a) with cin.good(), also when i format your code it becomes obvious that c isn't checked at all. layout is important, it will help you see problems.