Untitled
unknown
plain_text
9 months ago
350 B
5
Indexable
#include <stdio.h>
int main(){
int small, i;
int n;
printf("Enter size of array: ");
scanf("%d",&n);
int a[n];
printf("Enter elements into array: ");
for(i = 0; i < n; i++)
scanf("%d", &a[i]);
small = a[0];
for(i = 1; i < n; i++){
if(a[i] < small)
small = a[i];
}
printf("The smallest value is %d", small);
return 0;
}Editor is loading...
Leave a Comment