CᴏᴅɪɴɢNᴇʀᴅ 💸🐾
Open in Telegram
༗ हरे कृष्णा ༗ "Lost in my own cosmos 💫 | Coding Need Patience 🥀🐾" ❝Face the failure, Until the Failure fails to face you.❞ — Dreamer » ChikuX69.netlify.app « DM ? " @ChikuXBot " : 404;
Show more376
Subscribers
No data24 hours
-57 days
-48430 days
Posts Archive
Day 03 👾:
Given an array arr[], the task is to reverse the array. Reversing an array means rearranging the elements such that the first element becomes the last, the second element becomes second last and so on.Day 02 👾:
Given an array of integersarr[], the task is to move all thezerosto the end of the array while maintaining the relative order of allnon-zeroelements.
Day 01 👾:
Given an array of positive integersarr[]of size n, the task is to find second largest distinct element in the array. Note: If the second largest element does not exist,return -1.
#include <stdio.h>
int check_dual_int(int arr[], int length) {
for (int i = 0; i < length; i++) {
for(int j=i+1; j< length; j++) {
if(arr[i] == arr[j]) {
return 1;
}
}
}
return 0;
}
int main() {
int arr[] = {1, 2, 3, 1};
int length = sizeof(arr) / sizeof(arr[0]);
if(check_dual_int(arr, length) == 1) {
printf("True");
} else {
printf("False");
};
return 0;
}