Created
April 2, 2020 03:49
-
-
Save aasumitro/62589d182d84e6643c4b0153eea92735 to your computer and use it in GitHub Desktop.
manual input array find value
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() | |
{ | |
int arr_size, arr_input, find; | |
printf("\n Please size of the array : "); | |
scanf("%d", &arr_size); | |
int arr[arr_size] = {}; | |
for (int i = 0; i < arr_size; i++) { | |
printf("\n Please enter array value index %d : ", i); | |
scanf("%d", &arr_input); | |
arr[i] = arr_input; | |
} | |
printf("\n\n Please Enter Number of elements in an array : "); | |
scanf("%d", &find); | |
int total = 0; | |
for(int i = 0; i < arr_size; i++) | |
{ | |
if (arr[i] == find) { | |
total++; | |
} | |
} | |
printf ("\n\nTotal array %d is %d \n", find, total); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment