Skip to content

Commit

Permalink
Merge pull request vglug#33 from SEENUVASANINDIA/main
Browse files Browse the repository at this point in the history
maximum_of_n_numbers_optimised_code
  • Loading branch information
vpmglug authored Oct 31, 2022
2 parents ee998ad + 80567cb commit 52d62ac
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions c/maximum_of_n_numbers.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include<stdio.h>
void main(){
int n,i,arr[500],max=0;
printf("Enter total number of element you need to find max:");
scanf("%d",&n);
printf("Enter the value one by one\n");
for (i=0;i<n;i++)
{
scanf("%d",&arr[i]);
if(arr[i]>max)
{
max=arr[i];
}
}
printf("The maximum element you entered is %d\n",max);
}

0 comments on commit 52d62ac

Please sign in to comment.