Testing.

Sunday, 5 February 2017

C programming language: C program to find maximum/largest element from the given array in c


#include<conio.h>
#include<stdio.h>
void main()
{
int arr[10];
int i,m;
printf("\nEnter Array Element:\n");
for(i=0;i<10;i++)
scanf("%d",&arr[i]);

printf("\nEntered Array Elements Are:\n");
for(i=0;i<10;i++)
printf(" %d",arr[i]);

m=arr[0];
for(i=0;i<10;i++)
{
if(arr[i]>m)
m=arr[i];
}
printf("\n %d Is The Max Element In Array:\n",m);
getch();
}

No comments:

Post a Comment