diff --git a/C/program-47/Readme.md b/C/program-47/Readme.md new file mode 100644 index 00000000..dccb21a0 --- /dev/null +++ b/C/program-47/Readme.md @@ -0,0 +1,13 @@ +Program 47 + +Write a program to find the maximum and minimum element in an array. + +Variable description-- + +n=Number of elements in an array + +a=Array of size N + +min= Holds the minimum element + +max=Holds the maximum element diff --git a/C/program-47/program.c b/C/program-47/program.c new file mode 100644 index 00000000..04e8a3c6 --- /dev/null +++ b/C/program-47/program.c @@ -0,0 +1,23 @@ +#include +int main() +{ + + int a[100],n,min,max; + printf("enter the size of the array"); + scanf("%d",&n); + printf("enter the elements of the array"); + for(int i=0;imax) + max=a[i]; + if(a[i]