Untitled
unknown
plain_text
4 years ago
735 B
5
Indexable
/******************************************************************************
Online C Compiler.
Code, Compile, Run and Debug C program online.
Write your code in this editor and press "Run" button to compile and execute it.
*******************************************************************************/
#include <stdio.h>
int main()
{
int max1, max2;
int arr[4];
arr[0] = 41;
arr[1] = 25;
arr[2] = 1;
arr[3] = 919;
max1 = arr[0];
max2 = arr[1];
for(int i = 0; i < 4; i++) {
if(arr[i] > max1) {
max2 = max1;
max1 = arr[i];
}
}
printf("%d \n", max1);
printf("%d \n", max2);
}
Editor is loading...