public int min(int[] arr)
{
int min = Integer.MAX_VALUE;
for(int e : arr) if(e<min) min=e;
return min;
}
#include main() { int array[100], minimum, size, c, location = 1; printf("Enter the number of elements in array\n"); scanf("%d",&size); printf("Enter %d integers\n", size); for ( c = 0 ; c < size ; c++ ) scanf("%d", &array[c]); minimum = array[0]; for ( c = 1 ; c < size ; c++ ) { if ( array[c] < minimum ) { minimum = array[c]; location = c+1; } } printf("Minimum element is present at location number %d and it's value is %d.\n", location, minimum); return 0; }
1010
1
You data has to be stored in the array arr[] of size 10.double min(const arr[], int arrSize){double minimum = arr[0];for (int j = 0; j < arrSize; j++){if (minimum > arr[j]){minimum = arr[j];}}return minimum;}
i want to write a simple without using pointer or array c program which will print greatest number when i give 20 number .........How far have you gotten so far?
write a division sentence modeled by an array that has 2 more rows than the number in each row
A square array is an array in which the number of rows is the same as the number of columns.
An example: int array [10]; yaaa this is write but for a simple programs on array and all data structure visit codingdatastructure.blogspot.com
void mail ( ); { int a, b c = a+b; printf ("%d",=c); }
Find the minimum and maximum of what? An array?
You can write a C++ fib pro using arrays but the problem is the prog becomes very complicated since u need to pass the next adding value in an array.....