Free help with homework

Why join Brainly?

  • ask questions about your assignment
  • get answers with explanations
  • find similar questions

Write a program to find the largest integer out of five given integer

In what language do u want me to answer?c?C++?Visual basic?
In which programming language do you want the program? C, C++, Java, Python?


#include <stdio.h> #include <conio.h> void main() { int a[25], i, large, small, n; clrscr(); printf("Enter the size of array(max 25)\n"); scanf("%d", &n); printf("Enter any %d integer array elements\n",n); for(i = 0; i < n; i++) { scanf("%d", &a[i]); } large = a[0]; small = a[0]; for(i = 1; i < n ; i++) { if(a[i] > large) { large = a[i]; } if(a[i] < small) { small = a[i]; } } printf("The largest element from the given array is %d \nThe smallest element from the given array is %d", large, small); getch(); }
0 0 0
The Brain
  • The Brain
  • Helper
Not sure about the answer?
Learn more with Brainly!
Having trouble with your homework?
Get free help!
  • 80% of questions are answered in under 10 minutes
  • Answers come with explanations, so that you can learn
  • Answer quality is ensured by our experts