In a gymnastic competition, scoring is based on the average
of all scores given by the judges excluding the maximum and
minimum scores.
Let the user input the number of judges, after that, input
the scores from the judges.
Output the average score.
Note: In case, more than two judges give the same score and
it happens that score is the maximum or minimum then just
eliminate two scores.
For example, if the number of judges is 5 and all of them
give 10 points each. Then the maximum and minimum score is
10. So the computation would be 10+10+10, this time.
The output should be 10 because 30/3 is 10.
No Answer is Posted For this Question
Be the First to Post Answer
how to return a multiple value from a function?
int DIM(int array[]) { return sizeof(array)/sizeof(int ); } main() { int arr[10]; printf(“The dimension of the array is %d”, DIM(arr)); }
Question: We would like to design and implement a programming solution to the reader-writer problem using semaphores in C language under UNIX. We assume that we have three readers and two writers processes that would run concurrently. A writer is to update (write) into one memory location (let’s say a variable of type integer named temp initialized to 0). In the other hand, a reader is to read the content of temp and display its content on the screen in a formatted output. One writer can access the shared data exclusively without the presence of other writer or any reader, whereas, a reader may access the shared memory for reading with the presence of other readers (but not writers).
void main() { if(~0 == (unsigned int)-1) printf(“You can answer this if you know how values are represented in memory”); }
void main() { void *v; int integer=2; int *i=&integer; v=i; printf("%d",(int*)*v); }
main( ) { int a[2][3][2] = {{{2,4},{7,8},{3,4}},{{2,2},{2,3},{3,4}}}; printf(“%u %u %u %d \n”,a,*a,**a,***a); printf(“%u %u %u %d \n”,a+1,*a+1,**a+1,***a+1); }
There were 10 records stored in “somefile.dat” but the following program printed 11 names. What went wrong? void main() { struct student { char name[30], rollno[6]; }stud; FILE *fp = fopen(“somefile.dat”,”r”); while(!feof(fp)) { fread(&stud, sizeof(stud), 1 , fp); puts(stud.name); } }
main() { int i=4,j=7; j = j || i++ && printf("YOU CAN"); printf("%d %d", i, j); }
# include<stdio.h> aaa() { printf("hi"); } bbb(){ printf("hello"); } ccc(){ printf("bye"); } main() { int (*ptr[3])(); ptr[0]=aaa; ptr[1]=bbb; ptr[2]=ccc; ptr[2](); }
main() { int i; clrscr(); printf("%d", &i)+1; scanf("%d", i)-1; } a. Runtime error. b. Runtime error. Access violation. c. Compile error. Illegal syntax d. None of the above
What is the hidden bug with the following statement? assert(val++ != 0);
main() { int i=_l_abc(10); printf("%d\n",--i); } int _l_abc(int i) { return(i++); }