document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. //----------------------------------------------------------------------------
  2. //Title - Write a program to create Dynamic Link Library for any mathematical
  3. //        operation and write an application program to test it.
  4. //----------------------------------------------------------------------------
  5.  
  6. ------------------------
  7. HEADER FILE (calc_sc.h) //separate file
  8. ------------------------
  9.  
  10. int sqrr(int);
  11. int cub(int);
  12.  
  13. ------------------------
  14. LIBRARY FILE (calc_sc.c) //separate file
  15. ------------------------
  16.  
  17. int cub(int a)
  18. {
  19. return a*a*a;
  20. }
  21.  
  22. int sqrr(int a)
  23. {
  24. return a*a;
  25. }
  26.  
  27. ------------------------
  28. MAIN PROGRAM (a5.c) //separate file
  29. ------------------------
  30.  
  31. #include<stdio.h>
  32. #include "calc_sc.h"
  33.  
  34. int main()
  35. {
  36.     int n, ans;
  37.     int ch;
  38.     do
  39.     {
  40.         printf("\\n menu \\n\\n 1. sqr : \\n\\n 2. cube : \\n\\n 3. Exit : \\n\\nEnter Your Choice : \\n");
  41.         scanf("%d",&ch);
  42.  
  43.         switch(ch)
  44.         {
  45.             case 1 :
  46.                 printf("\\n Enter Number : ");
  47.                 scanf("%d",&n);
  48.                 ans=sqrr(n);
  49.    
  50.                 printf("\\n The Sqr of %d is %d \\n",n,ans);
  51.        
  52.                 break;
  53.    
  54.             case 2 :
  55.                 printf("\\n Enter Number : ");
  56.                 scanf("%d",&n);
  57.                 ans=cub(n);
  58.    
  59.                 printf("\\n The Cube of %d is %d \\n",n,ans);
  60.        
  61.                 break;
  62.    
  63.             case 3 :
  64.                 break;
  65.    
  66.             default :
  67.                 printf("\\n Invalid Choice ");
  68.                 }
  69.             }while(ch!=3);
  70.         return 0;
  71.     }
  72.  
  73. ------------------------
  74. END OF THE PROGRAM
  75. ------------------------
');