In: Computer Science
Name three types of errors that are likely to occur in programs:
Which one of these would apply to the following:
A semicolon left off the end of a statement
Using the following statement in a program:
Average = 10 + 20 + 30/3;
Trying to take the square root of a negative number
Forgetting to include the
cout<<”Please enter a number “<<endl;
a. A semicolon left off the end of a statement gives "compile time error" b. Average = 10 + 20 + 30/3; The above statement gives logical error. It should be like below Average = (10 + 20 + 30)/3; c. Trying to take the square root of a negative number gives logic error. d. Forgetting to include thelibrary and then using the thee following statement gives compile-time error