C PROGRAMMING please help with these thank you so much Find

C++ PROGRAMMING, please help with these, thank you so much!

Find and correct the errors in the code below so it can compile and execute. Name the errors you corrected and provide the program output. When included in the main () function, the return theta convention is used to inform the compiler that the program executed properly. In the program below, which of the two return theta statements actually tells the compiler the code ended satisfactorily? Justify your answer. What is the final value of c?

Solution

7)

#include <iostream>
//add ; end
using namespace std;
//Change from int to double and add ; at end
double funct(double nput1,double nput2);
int main()
{
   //change end line to endl & add ; at end
   cout<<funct(3.1,5)<<\" \"<<funct(4,7.6)<<endl;
}
//change function name to funct instead of func
double funct(double input1,double input2)
{
   //chagen i(1) to i=1
   int i=1;
   //change >> to >
   while((input1-i)>0)
   {
       input2 += i;
       ++i;
   }
   return input2;
}

Output is: 11 13.6

8) The return 0 in main tells the compiler that the program has executed succesfully. We know that the program execution starts in main. It proceeds line by line. Once the function trial is called it is executed and the value is returned and the execution of main is resumed. So it ends when return 0 in main is called.

C++ PROGRAMMING, please help with these, thank you so much! Find and correct the errors in the code below so it can compile and execute. Name the errors you cor

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site