Finding the largest number in the given array in C

Finding the largest number is the given array

Source code :

#include<stdio.h>

int main(){

int array[] = {10,20,7,8,87,98,104,6,23,65,35};
int i,max = 0;

int size = sizeof(array)/sizeof(array[0]);

for(i=0 ; i < size ; i++){
    
    if(array[i] > max){
        max = array[i];
    }
    
}

printf("The largest number is the given array %d",max);

return 0;

}

Output :

The largest number is the given array 104

Output :


                

Comments :