Lxih, 2200
mov c,m
inxh
mov a,m
inxh
cmp m
jc l1
mov a,m
dcr c
jnz l2
inhx
mov m,a
hlt
A program which is used to count the number of numbers in an array using a 8085 microprocessor is known as a assembly language program.
How to write a program for mouse in microprocessor?
assembly language program for sorting an array using 8086 microprocessor.
To find the kth smallest number in an unsorted array, you can use a sorting algorithm like quicksort or heapsort to arrange the array in ascending order. Then, you can simply access the kth element in the sorted array to find the kth smallest number. This process ensures that the kth smallest number is easily identified and retrieved from the array.
find even number in array
To separate odd and even numbers from an array of 10 numbers in the 8085 microprocessor, you can utilize a loop and the AND instruction. First, load each number from the array into a register and perform a bitwise AND operation with the value 1. If the result is 0, the number is even; if the result is 1, the number is odd. You can then store the odd numbers in one memory location and the even numbers in another, iterating through the entire array until all numbers are processed.
The value of the kth smallest element in the array is the kth element when the array is sorted in ascending order.
1010
Arrange the any one of the order and store the memory in order vice (ie.Ascending for Descending) Then print the second data of that array it is simple way
#include<stdio.h> void main() { int a[10],n,i,large,small; printf("enter the value of n\n"); scanf("%d",&n); printf("enter the elements\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("largest element in the array id %d\n",large); printf("smallest element in the array is %d\n",small); }
i want to write a simple without using pointer or array c program which will print greatest number when i give 20 number .........How far have you gotten so far?
final double[] ns = new double[10]; final Random rnd = new Random(System.currentTimeMillis()); // Fill... for (int i = 0; i < ns.length; ++i) { ns[i] = rnd.nextDouble(); } // Get largest/smallest... double largest = Double.MIN_VALUE; double smallest = Double.MAX_VALUE; for (double n : ns) { if (n > largest) { largest = n; } if (n < smallest) { smallest = n; } } // largest and smallest are now the proper values.