The project is to write a program that reads three integers and then prints them in order read and reversed. use four functions: main, one to read the data, one to print them in the order read, and one to print them reversed I get the errors:
In fuction 'main':
[Error] expected declaration or statement at end of input
recipe for target 'main.o' failed
#include <stdio.h>
#include <stdlib.h>
/* run this program using the console pauser or add your own getch,
system("pause") or input loop */
int main(int argc, char *argv[]) {
int getData ( );
void printForward (int first, int second, int third);
void printReversed (int first, int second, int third);
int main (void)
{
int a;
int b;
int c;
a=getData();
b=getData();
c=getData();
printForward ( a, b, c);
printReversed ( a, b, c);
int getData();
{
int num;
printf ("Enter an integer: ");
scanf ("%d", &num);
return num;
}
void printForward (int a, int b, int c);
{
printf ("\nNumbers in order: %d, %d, and %d\n", a, b, c);
return;
}
void printReversed (int a, int b, int c);
{
printf ("\nNumbers reversed: %d, %d, and %d\n",
c, b, a);
return;
}
return 0;
}