ok, here's the question: Write a program that reads three integers and then prints them in the order read and reversed. Use three functions, one to read the data, one to print them in the order read, and one to print them reversed.
Now I know that this should be a simple problem, but hey...i'm new.
Here's what I have so far:
Code:
#include <stdio.h>
#include <stdlib.h>
/*Prototype Declarations*/
void printforward (int *a,
int *b,
int *c);
void printback (int *a,
int *b,
int *c);
void readit (int a, int b, int c);
int main(void)
{
/*Local Definitions*/
int a;
int b;
int c;
/*Statements*/
readit (a, b, c);
printforward (&a, &b, &c);
printback (&c, &b, &a);
return 0;
} /*main*/
/*====================readit===================*/
void readit (int a,
int b,
int c);
{
/*Statements*/
printf("\nEnter three integers:\n");
scanf("%d %d %d", &a, &b, &c);
} /*readit*/
/*================printforward================*/
void printforward (int *a,
int *b,
int *c)
{
/*Statements*/
printf("\nThe numbers forward are: %d %d %d", *a, *b, *c);
return;
}/*printforward*/
/*================printback===================*/
void printback (int *a,
int *b,
int *c)
{
/*Statements*/
printf("\nThe numbers backward are: %d %d %d", *c, *b, *a);
return;
/*printback*/
system("PAUSE");
}
Now admittedly, I'm a bit clueless right now, but I would appreciate any help you guys could give.
Thanks
melee