C Program to Find Largest Element in an Array

C Program to Find Largest and Smallest Element in an Array 0

C Program to Find Largest and Smallest Element in an Array

Program 1 //Largest element from array #include<stdio.h> #include<conio.h> int main() { system(“cls”); int ar[500],n,i,max,pos; printf(“\n Enter the limit:”); scanf(“%d”,&n); printf(“Enter elements in array:\n”); for(i=0;i<n;i++) scanf(“%d”,&ar[i]); max=ar[0]; //max=0; pos=0; for(i=1;i<n;i++) { if(ar[i]>max) { max=ar[i]; pos=i;...