Posts

Showing posts with the label two dimensional array

Array Program #4

Image
7. Read n numbers in an array, read two different numbers, search the first number in an array and replace it with another number in an array and print its index and final array. #include <stdio.h> int main() {     int array[100], x,y, i, n, count = 0;               printf("Enter the number of elements in array\n");      scanf("%d", &n);            printf("Enter %d numbers\n", n);            for (i = 0; i < n; i++)         scanf("%d", &array[i]);             printf("Enter n number by which you want to replace?\n");      scanf("%d",&x);          printf(" By which number?\n");      scanf("%d",&y);   ...