Trivial Mistake

 avatar
unknown
c_cpp
2 years ago
331 B
12
Indexable
#include <iostream>
#include <vector>

using namespace std;
 
bool leap (int y)
{
    if(y%4==0&&y%100!=0||y%400==0)
    {
        return 1 ;
    }
}

int main()
{
    const int arr_size = 5;
    int arr[arr_size] = {3, 4, 200, 100, 400};
    for(int i=0; i<arr_size; i++) {
        cout<< leap(arr[i])<< " ";
    }
    return 0;
}
Editor is loading...
Leave a Comment