Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <time.h>
- #include <stdlib.h>
- int randint(int a, int b) {
- return (rand() % (b - a + 1)) + a;
- }
- int main(void) {
- srand(time(0));
- int a[10];
- for (int i = 0; i < 10; i++) {
- a[i] = randint(-10, 10);
- printf("%d ", a[i]);
- }
- int min_value = 1005;
- for (int i = 0; i < 10; i++) {
- if (a[i] < min_value) {
- min_value = a[i];
- }
- }
- printf("\nMin indexes: ");
- for (int i = 0; i < 10; i++) {
- if (a[i] == min_value) {
- printf("%d ", i);
- a[i] = 0;
- }
- }
- printf("\n");
- for (int i = 0; i < 10; i++) {
- printf("%d ", a[i]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement