Advertisement
Guest User

Untitled

a guest
Jan 30th, 2015
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. void ss()
  5. {
  6. printf("\t\t\t\tSelection Screen\n\n");
  7. printf("1 - Polynomial Evaluation\n");
  8. printf("2 - Statistical Algorithm\n");
  9. printf("3 - Matrix Operations\n");
  10. printf("4 - Exit\n\n");
  11. }
  12.  
  13. void polynomialEval()
  14. {
  15. int poly[10],n=0,i=0;
  16. printf("\nhow many input:");
  17. scanf("%d",&n);
  18. if(n>10)
  19. printf("Error: Only maximum of 10 inputs");
  20. else if(n<0)
  21. printf("Error: value must be greater than zero");
  22. else{
  23. for(i=0; i<n;i++)
  24. {
  25. printf("\nEnter poly[%d]=",i);
  26. scanf("%d",&poly[i]);
  27. }
  28. }
  29.  
  30. for(i=0;i<n;i++)
  31. {
  32. printf("%dx^%d",poly[i],i);
  33. if(i<n-1)
  34. printf("+");
  35. }
  36. printf("\n\n\n");
  37. }
  38.  
  39. void statisticalAlgo()
  40. {
  41. int num=0;
  42. printf("1-mean\n");
  43. printf("2-standard deviation\n");
  44. printf("3-summation\n");
  45. printf("Choose a number: ");
  46. scanf("%d",&num);
  47.  
  48. if(num==1)
  49. {
  50.  
  51. }
  52. else if(num==2)
  53. {
  54.  
  55. }
  56. else
  57.  
  58. }
  59.  
  60. int main(){
  61.  
  62. int num=0;
  63.  
  64. do{
  65. ss();
  66. scanf("%d",&num);
  67. switch(num)
  68. {
  69. case 1: system("cls");
  70. polynomialEval();
  71. break;
  72.  
  73. case 2: system("cls");
  74.  
  75. printf("\n\ncase 2\n\n");
  76. break;
  77.  
  78. case 3: system("cls");
  79. printf("\n\ncase 3\n\n");
  80. break;
  81. case 4: printf("Bye. Thank you");
  82. exit(0);
  83. break;
  84. }
  85. }while(num!=4);
  86.  
  87. system ("PAUSE");
  88. return 0;
  89. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement