int
getLargest(int array[], const int asize) {
int largest = array[0];
int i;
for (i = 1; i < asize; ++i) {
if (largest < array[i])
largest = array[i];
}
return largest;
}
Wiki User
∙ 2009-12-09 12:50:15write a program to find prime number between 1 to500
How do you write a c program to find maximum and minimum number in a given array?
You add numbers as follows: sum = a + b;
Is this a question? If it is, the answer is: 'yes, do write'.
int i, largest=0;do { scanf ("Enter a number (0 to exit): %d", i); if (i>largest) largest=i; } while (i!=0); printf ("Largest number is: %d\n", largest);
program to find maximum of two numbers using pointers
write an assembly language program to find sum of N numbers
VBnet program to find the prime numbers between 100 to 200?
write a program to find prime number between 1 to500
How do you write a c program to find maximum and minimum number in a given array?
k
no
To find the largest of three numbers, first find the largest of two numbers: int max (int x, int y) { return x<y?y:x; } Now you can use this one function to find the largest of three numbers: int max (int x, int y, int z) { return max (max (x, y), z); }
You add numbers as follows: sum = a + b;
Is this a question? If it is, the answer is: 'yes, do write'.
int i, largest=0;do { scanf ("Enter a number (0 to exit): %d", i); if (i>largest) largest=i; } while (i!=0); printf ("Largest number is: %d\n", largest);
i need this answer