Professional Documents
Culture Documents
void main()
{
int arr1[100];
int i, mx, mn, n;
printf("\n\nFind maximum and minimum element in an array :\n");
printf("--------------------------------------------------\n");
printf("Input the number of elements to be stored in the array :");
scanf("%d",&n);
printf("Input %d elements in the array :\n",n);
PROGRAM
if (arr1[i]%2 == 0)
{
arr2[j] = arr1[i];
j++;
Write a program in C to }else
{ arr3[k] = arr1[i]; k++;
separate odd and even integers }
into separate arrays. }
printf("\nThe Even elements are : \n");
for(i=0;i<j;i++)
{
printf("%d ",arr2[i]);
}
printf("\nThe Odd elements are :\n");
for(i=0;i<k;i++)
{
printf("%d ", arr3[i]);
}
printf("\n\n");
}
Write a program that can
read three integers from the
user and then determines
the smallest value among
the three integers. Using
Array
#include <stdio.h>
int main()
{
int avg = 0;
int sum =0;
int x=0;
int num[4];
In the recent IIEE convention, the unity dance was participated by the EE 1st – 4th year students. The
judges were allowed to input score from 1-10 out of 8 criteria for judging. Each contestant’s score is
calculated by dropping the lowest and highest scores and then adding the remaining scores. Please
create a program that allows the user to enter eight judges’ scores and then outputs the point received
by the contestant. A judge awards point between 1 and 10, with 1 being the lowest and 10 being the
highest. For example, if the scores are:
9.2, 9.3, 9.0, 9.9, 9.5, 9.5, 9.6 and 9.8, then the contestant receives a total of
Total points: 56.9 points.
Highest: 9.8
Lowest: 9.0
Average: 7.1125
After inputting the score to the different contestants, will display the winner of the competition with a
highest average points
(Note: You must use array in your solution for this problem)