In: Computer Science
Write a C program that reads three integers and then prints them in the 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.
#include <stdio.h>
void getData(int *a){
printf("Enter data: ");
scanf("%d", a);
}
void printDataOrder(int a, int b, int c){
printf("Inorder: %d %d %d\n", a,b,c);
}
void printDataReverseOrder(int a, int b, int c){
printf("Reverse: %d %d %d\n", c,b,a);
}
int main(void) {
int a, b , c;
getData(&a);
getData(&b);
getData(&c);
printDataOrder(a, b, c);
printDataReverseOrder(a, b, c);
return 0;
}
============================================================
SEE OUTPUT
========================================
Thanks, let me now if there is any concern.