C program to find out largest element of an array.

source code


#include<stdio.h>
int main()
{
  int a[50],size,i,big;
  printf("\nEnter the size of the array: ");
  scanf("%d",&size);
  printf("\nEnter %d elements in to the array: ”, size);
  for(i=0;i<size;i++)
  scanf("%d",&a[i]);
  big=a[0];
  for(i=1;i<size;i++)
{
 if(big<a[i])
           big=a[i];
  }
  printf("\nBiggest: %d",big);
  getch();
  return 0;
}

Comments

Popular posts from this blog

8086 STRING MANIPULATION –FIND AND REPLACE A WORD

Animated Circles In C++

C program to find out the sum of series 1 + 2 + …. + n.