I am working on a program which test to see if a number is perfect but before I can ensure that I am testing for perfect numbers properly. I have to compile the code to see if the test results are correct.
Errors are as follows
Line 4 & 18 - too few arguments to
Line 34 & 35 - at this point in file
How do I use "goto" so that I can tell the program to go to a certian line or a certian function?
Code:
#include <stdio.h>
int readud(int pVal, int perfect() ) // Read User Data
{
printf ("Please Enter An Integer To Sum: ");
scanf ("%d",pVal);
if (pVal > 1000)
{printf ("\n\tError: The integer you entered exceeds the limit.\n\tPlease try again and enter an integer between 1 and 1000.\n\nPlease Enter An Integer To Sum: ");
}else
return(pVal);
}
int perfect(int n) // Do The Math
{
if ((n%2) == 0)
{printf("True: The integer you entered is perfect\n");
printf("%d\t",n); // value found
}else
{printf ("\n\tFalse: The integer you entered is not perfect.\n\tPlease try again.\n\nPlease Enter An Integer To Sum: ");
}
}
main()
{
int n, pVal;
pVal = readud();
n = perfect();
printf("True: The integer you entered is perfect\n\n%d\t",n);
return 0;
}
Errors are as follows
Line 4 & 18 - too few arguments to
Line 34 & 35 - at this point in file
How do I use "goto" so that I can tell the program to go to a certian line or a certian function?