Back at this again with another question from this amazing community. Before I get into my question, I just want to thank everyone again for taking what seems to be such easy answers to my questions for many of you and helping me out greatly to where I have been able to excel in my class thus far! Much appreciated!!!

We just started chapter 5 which deals with selection and my lab assignment I had to use at least one function in addition to main, must use selection, and must use the indirection pointer.

My question is did I use the if/else statement correctly? The lab calls for you to do nothing with the integers if they are already placed in the smallest to largest order. Variable e & f both evaluate to 6 and the lab says to do nothing if they are already smallest to largest. So I typed my if/else statement for variable e & f as

if (e <= f) printf ("\t Result 3: %3d\t%3d\n", e, f); else printf ("\t Result 3: %3d\t%3d\n", e, f);

Is that above if/else statement really saying to do nothing with the order? Technically it's still true/false isn't it because I'm saying if it's not this then do this but that doesn't really seem like doing nothing to the order if it's already in smallest to largest order.

The program seems to run perfect but I wanted to know from this community if I'm going about the coding process correctly or did I bloat it when where it isn't necessary. I've included the entire program I wrote for the visuals. Any advice on what I can do to make it better would be greatly appreciated.

/* Develop a program to meet the following requirements: 1. Must use at least one function in addition to main 2. Must use selection 3. Must use deference/indirection (the * operator) Take two integers as input, compare them and put them in smallest to largest order. If they are not in smallest to largest order, use an exchange function to swap their order. If they are already in order, do nothing. Output both integers in smallest to largest order. Use the following integer pairs as input (you will want to use more). 7 12 18 3 6 6 -12 0 */ #include <stdio.h> //Function Declarations void swap (void); void original (int* a, int* b, int* c, int* d, int* e, int* f, int* g, int* h, int* i, int* j, int* k, int* l); int main (void) //Function "Main" Begins { //Local Declarations int a; int b; int c; int d; int e; int f; int g; int h; int i; int j; int k; int l; original (&a, &b, &c, &d, &e, &f, &g, &h, &i, &j, &k, &l); //calling function "Original" swap (); //calling function "Swap" return 0; //Return control back to operating system } //Function "Main" Ends void original (int* a, int* b, int* c, int* d, int* e, int* f, int* g, int* h, int* i, int* j, int* k, int* l) //Function "Original" Begins { //Local Declarations *a = 7; *b = 12; *c = 18; *d = 3; *e = 6; *f = 6; *g = -12; *h = 0; *i = 17; *j = 9; *k = 49; *l = 23; //Statements printf ("\n==============================\n"); printf ("Original Order of the Integers\n"); printf ("==============================\n"); printf ("\n\t Result 1: "); printf ("%3d\t%3d\n", *a, *B)/>; printf ("\t Result 2: "); printf ("%3d\t%3d\n", *c, *d); printf ("\t Result 3: "); printf ("%3d\t%3d\n", *e, *f); printf ("\t Result 4: "); printf ("%3d\t%3d\n", *g, *h); printf ("\t Result 5: "); printf ("%3d\t%3d\n", *i, *j); printf ("\t Result 6: "); printf ("%3d\t%3d\n", *k, *l); return; } //Function "Original" Ends void swap (void) //Function "Swap" Begins { //Local Declarations int a; int b; int c; int d; int e; int f; int g; int h; int i; int j; int k; int l; a = 7; b = 12; c = 18; d = 3; e = 6; f = 6; g = -12; h = 0; i = 17; j = 9; k = 49; l = 23; printf ("\n==============================\n"); printf (" Swap Order of the Integers\n"); printf ("==============================\n"); if (a <= B)/> printf ("\n\t Result 1: %3d\t%3d\n", a, B)/>; else printf ("\t Result 1: %3d\t%3d\n", b, a); if (c <= d) printf ("\t Result 2: %3d\t%3d\n", c, d); else printf ("\t Result 2: %3d\t%3d\n", d, c); if (e <= f) printf ("\t Result 3: %3d\t%3d\n", e, f); else printf ("\t Result 3: %3d\t%3d\n", e, f); if (g <= h) printf ("\t Result 4: %3d\t%3d\n", g, h); else printf ("\t Result 4: %3d\t%3d\n", h, g); if (i <= j) printf ("\t Result 5: %3d\t%3d\n", i, j); else printf ("\t Result 5: %3d\t%3d\n", j, i); if (k <= l) printf ("\t Result 6: %3d\t%3d\n\n", k, l); else printf ("\t Result 6: %3d\t%3d\n\n", l, k); return; } //Function "Swap" Ends /* Sample output of my program for Lab # 4 ============================== Original Order of the Integers ============================== Result 1: 7 12 Result 2: 18 3 Result 3: 6 6 Result 4: -12 0 Result 5: 17 9 Result 6: 49 23 ============================== Swap Order of the Integers ============================== Result 1: 7 12 Result 2: 3 18 Result 3: 6 6 Result 4: -12 0 Result 5: 9 17 Result 6: 23 49 */