Hi friends, i am getting errors for this program, saying illegal start of expression, and not a statement. I am unable to figure it out. Please answer me. I would be glad. It is simple but i am unable to do.
QUestion is that, i need to ask user to enter 3 edges of triangle and decide if it is valid triangle or no.
if any two sides of a triangleis greater than third side then it is valid triangle.
else it is not valid. Here is my code.
It's a lot easier for us if you tell us the exact line you're getting the error on. I can see at least one error though - it should be true and false, not True and False.
Just count the brackets in your if-statements and you'll find your problem.
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
Once you've fixed that, it may well work. But why have you got two complicated conditions? If the first test fails, you know the triangle is invalid. There's no need to test again.
Thank you guys, I got it. Fred rossenberger is correct. this program works for 1,2,3. also. The requirement was like that so i had to write it like this i mean, it was an exercise from book. introduction to programming by danial liang, i am learning from this books exercises... true and false were correct only, does not matter small or caps. I needed to put them in inverted commas. that i forgot.
Thank you soo much you all guys, and special thank you to Fred Rossenberger. I would be glad if i can learn good programming. I would be sooooo much thankfull to each single guy who responded to me. Thank you again.