Advertisement
aiNayan

5(ii)

Nov 28th, 2020
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #include <stdio.h>
  2. int main()
  3. {
  4. int a[50], n, i, large = 0;
  5. printf("Enter the number of elements: ");
  6. scanf("%d", &n);
  7. printf("Enter the elements: ");
  8. for (i = 1; i <= n; i++) {
  9. scanf("%d", &a[i]);
  10. if (a[i] >= large)
  11. large = a[i];
  12. }
  13. printf("Largest Element is = %d", large);
  14. return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement