Advertisement
Niloy007

File + array

Mar 7th, 2021
603
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.63 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. // int arr[100];
  5. // int size = 0;
  6.  
  7. // void takingInput() {
  8. //  printf("Enter the size of the array\n");
  9. //  scanf("%d", &size);
  10. //  printf("Enter the elements of the array\n");
  11. //  for (int i = 0; i < size; i++) {
  12. //      scanf("%d", &arr[i]);
  13. //  }
  14. // }
  15.  
  16. // void printArray() {
  17. //  printf("Array:\n");
  18. //  for (int i = 0; i < size; i++) {
  19. //      printf("%d ", arr[i]);
  20. //  }
  21. //  printf("\n");
  22. // }
  23.  
  24. // void deleteItem() {
  25. //  printf("Enter the index:\n");
  26. //  int index;
  27. //  scanf("%d", &index);
  28. //  for (int i = index; i < size; i++) {
  29. //      arr[i] = arr[i + 1];
  30. //  }
  31. //  size--;
  32. // }
  33.  
  34. // int main() {
  35. //  takingInput();
  36. //  printArray();
  37. //  int flag = 1;
  38. //  while (flag) {
  39. //      printf("Do you want to delete item?\n");
  40. //      printf("if 'YES' then press 1 otherwise press any key\n");
  41. //      int choise;
  42. //      scanf("%d", &choise);
  43. //      if (choise == 1) {
  44. //          deleteItem();
  45. //          printArray();
  46. //      } else {
  47. //          flag = 0;
  48. //      }
  49. //  }
  50. //  printArray();
  51. // }
  52.  
  53. // int main() {
  54. //  printf("%f\n", pow(2, 3));
  55. // }
  56.  
  57. // #define rep(i, a, b) for (int i = a; i <= b; i++)
  58. // #define MAX 10000
  59.  
  60. // int main() {
  61. //  rep(i, 1, 10) {
  62. //      printf("%d\n", i);
  63. //  }
  64. //  printf("%d\n", MAX);
  65. // }
  66.  
  67. // int main() {
  68. //  FILE *file = fopen("text.txt", "r");
  69. //  char name[100];
  70. //  int id;
  71. //  double result;
  72.  
  73. //  if (file == NULL) {
  74. //      printf("File does not exist\n");
  75. //  } else {
  76. //      while (fscanf(file, "%s %d %lf", name, &id, &result) != EOF) {
  77. //          printf("%s %d %.2lf\n", name, id, result);
  78. //      }
  79. //  }
  80. //  fclose(file);
  81. // }
  82.  
  83. /// EOF -> End of file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement