I do not know what i did to make this run wrong. It is supposed to find the smallest number.
I do not know what i did to make this run wrong. It is supposed to find the smallest number. c programing
#include<stdio.h>
int main() {
int a[10], i, num, smallest;
printf(“\nEnter no of elements :”);
scanf(“%d”, &num);
//Read n elements in an array
for (i = 0; i < num;)
scanf(“%f”, a[i]);
//Consider first element as smallest
smallest = a[0];
for (i = 0; i < num;) {
if (a[i] < smallest) {
smallest = a[i];
}
}
// Print out the Result
printf(“\nSmallest Element : %d”, smallst);
return (0);