C0D1NG / Data-Structures

30 stars 144 forks source link

Find the largest element in the Array submitted by Abhishek( github:- Abkt2001 ) #215

Closed Abkt2001 closed 3 years ago

Abkt2001 commented 4 years ago

include

int main() { int a; printf("Enter the length of array "); scanf("%d",&a);

int arr[a],i,j;

printf("Enter the array elements ");

for(i=0;i<a;i++)
    scanf("%d",&arr[i]);

for(i=0;i<a;i++)
    {
        if(arr[i]>arr[i+1])
            {
                j=arr[i];
                arr[i]=arr[i+1];
                arr[i+1]=j;
            }
    }

printf("Largest element in the array is ");
printf("%d",arr[a-1]);

}

welcome[bot] commented 4 years ago

Congrats on creating your first Issue in the C0D1NG Organization! 🥳

Abkt2001 commented 3 years ago

Problem solved