#include #define SIZE 50 int main( ) { int scores[SIZE]; int i, n, pass, item, p
ID: 3529930 • Letter: #
Question
#include #define SIZE 50 int main( ) { int scores[SIZE]; int i, n, pass, item, position, temp; /* Get number of values to read */ printf("Please enter number of scores (%d or less): ", SIZE); scanf("%d", &n); /* Validate number entered by user. */ if (n<=SIZE && n>0){ /* Read score values into array */ for(i=0; i< scores[item]) position = item; if(pass != position){ temp = scores[pass]; scores[pass] = scores[position]; scores[position] = temp; } } /* Display scores in sorted order */ printf(" The scores in order. "); for(i=0; iExplanation / Answer
#include <stdio.h>
int main()
{
int thermo, drawing, chemistry, math, c,total;
printf(" Marks in: ");
printf(" thermo = ");
scanf("%d",&thermo);
printf(" drawing = ");
scanf("%d",&drawing);
printf(" chemistry = ");
scanf("%d",&chemistry);
printf(" math = ");
scanf("%d",&math);
printf(" c = ");
scanf("%d",&c);
total=math+thermo+chemistry+drawing+c;
if(thermo<40 || chemistry<40 || drawing<40 || math<40 || c<40)
printf(" Result: FAIL");
else
printf(" Result: PASS");
printf(" Percentage:%0.2f ",total/5.0);
printf(" NOTE: Total for each subject is 100 ");
return 0;
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.