answersLogoWhite

0


Best Answer

1

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you write the 8051 micro controller alp for finding the largest number in an array?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is an array controller?

An array controller is a controller of any array of equivalent hardware components.


Write a function in java that accepts an array of integers and returns the second largest integer in the array Return -1 if there is no second largest?

Method 1: Sort the array in descending order, compare 1st and 2nd if not same , return 2nd if same return -1 Method 2: Find the largest number in the array, initialize another array with dimension 1 less than of original. Copy the array elements from the original array minus the largest element. not select largest from the second array and compare with the previous one if not same return the second largest if same return -1


What is the condition of second largest number?

There is no such condition. The algorithm to locate the second largest number in an array of numbers is: Sort the array in descending order. Remove the duplicate values from the array. If there are two or more elements remaining, return the second number. If there is less than two elements remaining, return the NaN value (not a number).


What is the 8085A microprocessor code for finding the largest number?

The processor makes no difference in C programming -- the compiler will generate the appropriate instructions for you. To find the largest number in a sequence of numbers, store the numbers in an array. Then invoke the following function, passing the array and its length: unsigned largest (double* num_array, unsigned size) { if (!num_array !size) return size; unsigned max = 0; unsigned index; for (index=1; index<size; ++index) if (num_array[index]>num_array[max]) max = index; return max; } The return value holds the index of the largest value in the array.


What is the complexity of largest and second largest element in terms of number of comparision in array consisting n numeric elements in random order.?

knowledge


What will be the algorithm to input n integers and output the largest one?

var largest : integer largest = array[0] for n : integer in array if n > largest largest = n endif endfor return largest


How do you write a C plus plus function lastLargestIndex that returns the index of the last occurrence of the largest element in the array?

int lastLargestIndex(int a[],int n) //a=array, n= number of elements in array { int max=a[0],maxp=0; //max=largest no., maxp= position of largest no. for(int i=0;i<n;i++) if(a[i]>=max) { max=a[i]; maxp=i; } return maxp; }


What is squre array?

A square array is an array in which the number of rows is the same as the number of columns.


What is the Program to find the largest element in an array and position occurrence?

#include<stdio.h> #include<conio.h> main() { int a[100]; int n,largest,index,position; printf("enter the number of elements in the array"); scanf("%d",&n); printf("enter %d elements",n); for(index=0;index<n;index++) scanf("%d",&a[index]); largest=a[0]; position=0; for(index=1;index<n;index++) if(a[index]>largest) { largest=a[index]; position=index; } printf("largest element in the array is %d\n",largest); printf("largets element's position in the array is %d\n",position+1); getch(); }


What is The number of elements in an array is called?

the length of the array


Biggest of three numbers using ternary operator in java?

// largest = largest of a, b, c public class largest { public static void main(String args[]) { int a,b,c,largest; a=0; b=0; c=0; a=Integer.parseInt(args[0]); b=Integer.parseInt(args[1]); c=Integer.parseInt(args[2]); largest=a>b?(a>c?a:c):(b>c?b:c); System.out.println("The largest no. of "+a+","+b+"and"+c+"is"+largest); } }


This array field holds the number of elements that the array has?

length