Answered You can hire a professional tutor to get the answer.

QUESTION

My code is not compiling correctly you someone take a look #include lt;stdio.hgt; int Square(int value); int Cube(int value); int Shrink(int...

My code is not compiling correctly you someone take a look

#include <stdio.h>

int Square(int value);

int Cube(int value);

int Shrink(int value);

int main ()

{

/* variable definition: */ 

  int intValue, menuSelect,Results;

  intValue = 1; 

  // While a positive number

while (intValue > 0)

{  

   printf ("Enter a positive Integern: ");

   scanf("%d", &intValue);

  if (intValue > 0)

  {

   printf ("Enter 1 to calculate Square, 2 to Calculate Cube, 3 to Calculate Shrinkn: ");

   scanf("%d", &menuSelect);

   if (menuSelect == 1)

   {

    // Call the Square Function

    Results = Square(intValue);

    printf("Square of %d is %dn",intValue,Results);

   }

   else if (menuSelect == 2)

   {

    // Call the Cube function

    Results = Cube(intValue);

    printf("Cube of %d is %dn",intValue,Results);

   }

   else if (menuSelect ==3)

// Call the Shrink Function

    Results = Shrink(intValue);

    printf("Shrink of %d is %dn",intValue,Results);

}

   else 

    printf("Invalid menu item, only 1 or 2 is acceptedn");

   }   

  }   

return 0;

}

/* function returning the Square of a number */

int Square(int value)

{

return value*value;

/* function returning the Cube of a number */

int Cube(int value)

{

  return value*value*value;

/* function returning the Shrink of a number */

int Shrink(int value)

{

  return value*value/2;

}

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question