SCHOOL OF CODE BUILDERS
Learn To CODE. Become A DEVELOPER.
Pages
HOME
DATA STRUCTURES
STRINGS
ARRAYS
MATRIX
BINARY TREES
LINKED LIST
STACK
QUEUE
SORTING
SEARCHING
C
PYTHON
PSEUDOCODE
CONTEST PROBLEMS
ALGORITHMS
PATTERNS
PHP
C PUZZLES
C INTERVIEW QUESTIONS
JAVA
C++
HASHING
RECURSION
BASIC C PROGRAMS
TCS-CODEVITA
FACEBOOK
CONTACT US
C program to find maximum element in an array
C program to find maximum element in an array
Input:
Enter the number of elements in the array: 5
Enter the elements of array:
65 2 78 -4 0
Output:
The maximum element in the array is 78
Implementation:
#include
#include
int main(void) { int a[1000],n,i,max=INT_MIN; printf("Enter the number of elements in the array:\n"); scanf("%d",&n); printf("Enter the elements of array:\n"); for(i=0;i
max) { max=a[i]; } } printf("The maximum element in the array is %d",max); return 0; }
PREVIOUS
NEXT
HOME