Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. printf_s("Number of equations (1-3):");
  2. scanf_s("%d", &numeq);
  3.  
  4. while (numeq < 0 || numeq>4)
  5. {
  6. printf_s("Please enter a number between 1-3.n");
  7. printf_s("Number of equations(1 - 3): ");
  8. scanf_s("%d", &numeq);
  9.  
  10. }
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18. if (numeq == 1)
  19. {
  20.  
  21. printf_s("Enter equation 1:");
  22. fgets(equations1, sizeof(equations1), stdin);
  23. getchar();
  24.  
  25. while (equations1[i] != '/0')
  26. {
  27.  
  28.  
  29.  
  30. mekdem[p] = equations1[i];
  31.  
  32. while (equations1[k] != 'x', 'y', 'z' || equations1[k] != '/0');
  33.  
  34. {
  35.  
  36. sum = equations1[k - 1] + sum * 10;
  37. k++;
  38. mekdem[p] = sum;
  39.  
  40. }
  41.  
  42.  
  43. i = k + 2;
  44.  
  45.  
  46. }
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  60.  
  61.  
  62.  
  63. if (numeq == 2)
  64. {
  65.  
  66. printf_s("Enter equation 1:");
  67. fgets(equations1, sizeof(equations1), stdin);
  68.  
  69. getchar();
  70.  
  71. printf_s("Enter equation 2:");
  72. fgets(equations2, sizeof(equations2), stdin);
  73.  
  74. getchar();
  75.  
  76.  
  77. }
  78.  
  79.  
  80.  
  81. if (numeq == 3)
  82. {
  83.  
  84. printf_s("Enter equation 1:");
  85. fgets(equations1, sizeof(equations1), stdin);
  86.  
  87. getchar();
  88.  
  89. printf_s("Enter equation 2:");
  90. fgets(equations2, sizeof(equations2), stdin);
  91.  
  92. getchar();
  93.  
  94. printf_s("Enter equation 3:");
  95. fgets(equations3, sizeof(equations3), stdin);
  96.  
  97. getchar();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement