Skip to content

Commit 52d62ac

Browse files
authored
Merge pull request #33 from SEENUVASANINDIA/main
maximum_of_n_numbers_optimised_code
2 parents ee998ad + 80567cb commit 52d62ac

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

c/maximum_of_n_numbers.c

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#include<stdio.h>
2+
void main(){
3+
int n,i,arr[500],max=0;
4+
printf("Enter total number of element you need to find max:");
5+
scanf("%d",&n);
6+
printf("Enter the value one by one\n");
7+
for (i=0;i<n;i++)
8+
{
9+
scanf("%d",&arr[i]);
10+
if(arr[i]>max)
11+
{
12+
max=arr[i];
13+
}
14+
}
15+
printf("The maximum element you entered is %d\n",max);
16+
}

0 commit comments

Comments
 (0)