-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLab05.c
57 lines (50 loc) · 1023 Bytes
/
Lab05.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//
// Created by nimrod on 03-Apr-22.
//
#include <stdio.h>
#include <malloc.h>
#include <ctype.h>
#include <string.h>
void find_divided(const int *arr, int size, int num) {
for (int i = 0; i < size; ++i) {
if ((*arr) % num == 0) {
printf("%d ", *arr);
}
arr++;
}
}
void remove_char(char *str, char char_to_remove) {
while (*str != '\0') {
if (*str == char_to_remove) {
char *p = str;
while (*(p + 1) != '\0') {
*p = *(p + 1);
p++;
}
*p = '\0';
}
str++;
}
}
//int main() {
// setbuf(stdout, NULL);
//
// int n;
// printf("Type n: ");
// scanf("%d", &n);
// int *arr = malloc(sizeof(int) * n);
// for (int i = 0; i < n; ++i) {
// printf("Type next number: ");
// scanf("%d", arr + i);
// }
// find_divided(arr, n, 5);
//
// char str[] = "abcrgcr";
// remove_char(str, 'r');
//
// printf("%s",str);
//
//
//
//
//}