Untitled

mail@pastecode.io avatar
unknown
plain_text
3 years ago
716 B
1
Indexable
Never
/******************************************************************************

                            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];
    
    for(int i = 0; i < 4; i++) {
        arr[i] = i;
    }
    
    max1 = arr[0];
    max2 = arr[1];
    
    
    for(int i = 0; i < 4; i++) {
        if(i > max1) {
            max2 = max1;
            max1 = i;
        }
    }
    printf("%d \n", max1);
    printf("%d \n", max2);
}