Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

How can I fix this error? I am running this on X-Code. #include double root 1(do

ID: 3924734 • Letter: H

Question

How can I fix this error? I am running this on X-Code. #include double root 1(double, double);//main function int main() {//local variables double n; double num1; double root; printf("Enter a number greater then 1: "); scanf ("%1f", &num1;); if(num1>1) {printf("Enter the value for 'n'(the root to be calculated): "); scanf ("%1f", &n;); root = root1(num1, n); printf ("%1f th Root of %1f ", n, num1, root);} else printf("Wrong entry"); return 0;}//root function double root1(double a, double b) {int j; double i, k=1; double incre = 0.01; for(i=1; i

Explanation / Answer

reeason:If for loop breaks due to introduction of break statement within if statement. here it is not finding the return statement,because break statement will directly take control outside the for loop.when break returns the control,if it does not find return statement.then the problem will be encountered

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote