home *** CD-ROM | disk | FTP | other *** search
/ Share Gallery 1 / share_gal_1.zip / share_gal_1 / LA / LA024.ZIP / SMAK.EXE / SAMPLE.C < prev    next >
Text File  |  1990-07-26  |  920b  |  49 lines

  1. /*************************************************************************
  2. *                                         *
  3. * SAMPLE.C                                 *
  4. *                                         *
  5. *************************************************************************/
  6.  
  7. #include <stdio.h>
  8. #include <stdlib.h>
  9.  
  10. void main(int argc,char *argv[]);
  11. void endgood(int,int,int);
  12. int smplad(int,int);
  13. int second_function(void);
  14. int third_function(void);
  15.  
  16. void main(int argc,char *argv[])
  17. {
  18.     int a,b,x;
  19.  
  20.      if (argc<3)
  21.     {
  22.         printf("\nUseage:  sample Num1 Num2\n");
  23.         endgood(2,a,b);
  24.     }
  25.     a=atoi(argv[1]);
  26.     b=atoi(argv[2]);
  27.  
  28.     if ((x=second_function())==1)
  29.     if ((x=third_function())==1)
  30.         endgood(1,a,b);
  31.     else
  32.         endgood(2,a,b);
  33. }
  34.  
  35. void endgood(int num,int a, int b)
  36. {
  37.     if (num==1)
  38.     {
  39.         printf("\n%d + %d = %d",a,b,smplad(a,b));
  40.         printf("\nThis is a good Exit.\n");
  41.         exit(0);
  42.     }
  43.     else
  44.     {
  45.         printf("\nThis is a bad Exit.\n");
  46.         exit(0);
  47.     }
  48. }
  49.