------------------------------- CST8165 Lab Attendance Exercise #81 - Week 1 ------------------------------- -Ian! D. Allen - idallen@idallen.ca - www.idallen.com This is a program to complete and submit as your record of attendance in the lab this week, and to get the spelling right in the header lines. Add the assignment label (from the submission standards part of my central teaching home page http://teaching.idallen.com/), fix the code, make sure it works, and submit the source file below. The submission command "cstsubmit" is documented in the class notes. Submit your completed and tested source file using this (exact) command line (spelling counts): $ ~alleni/bin/cstsubmit 81 myorder.c Your source begins here: /* * Your Assignment Submission Label goes here. Spelling counts. * See http://teaching.idallen.com/assignment_standards.html */ /* * Add the minimum number of IF statements to this program so that no matter * what three numbers are used for input the output is in ascending order: * n1 <= n2 <= n3 * The program must work for any three integers on the command line. * You may assume that three integers will allways be supplied. * You may assume that the largest integer will fit in 32 bits, signed. * * Do not use a loop or bubble sort - all you need is IF statements. * Do not use more IF statements than necessary to order three numbers. * Keep it the code as simple as you can. */ #include #include int main(int argc, char **argv){ /* NOTE: no argc checking - program will fault on missing args */ int x = atoi(argv[1]); /* this could be any integer */ int y = atoi(argv[2]); /* this could be any integer */ int z = atoi(argv[3]); /* this could be any integer */ /* * Put your IF statements here to make x <= y <= z */ printf("%d <= %d <= %d\n",x,y,z); /* do not change this output line */ return 0; }