Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
682 views
in Computer by (50.9k points)
closed by

Write the definition of a function grace_score (int score[], int size) in C++, which should check all the elements of the array and give an increase of 5 to those scores which are less than 40. 

Example: if an array of seven integers is as follows: 

45, 35, 85, 80, 33, 27, 90 

After executing the function, the array content should be changed as follows: 

45, 40, 85, 80, 38, 32, 90

1 Answer

+1 vote
by (45.3k points)
selected by
 
Best answer

void grace_score(int score[], int size) 

for (int i=0; i <size, i++) 

if(score[i]<40) 

score[i]=score[i]+5; 

cout<<score[i] <<" ";

}
}

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...