Average Marks Problem Statement
Given the initial letter of a student's name and three integer marks for that student, calculate and display the student's initial letter followed by the integer part of their average marks.
Example:
Input:
'K'
M1 = 10, M2 = 6, M3 = 9
Output:
K 7
Explanation:
The average of the marks 10, 6, and 9 is approximately 7.67. Thus, we only display the integer part, which is 7.
Input:
Each test consists of:
An integer T, the number of test cases.
For each test case:
Character 'firstLetterOfName'
Three integers 'M1', 'M2', and 'M3'
Output:
For each test case, display the initial letter of the student's name and the integer part of their average marks on a new line.
Constraints:
- 1 <= T <= 10
- 'A' <= 'firstLetterOfName' <= 'Z'
- 0 <= M1, M2, M3 <= 100
Note: Ensure to display only the integer part of the average, disregarding any decimal portion.
AnswerBot
7d
Calculate and display the student's initial letter followed by the integer part of their average marks.
Calculate the average of the three marks provided for each student.
Display the initial letter of ...read more
Help your peers!
Add answer anonymously...
Top Hike Software Developer interview questions & answers
Popular interview questions of Software Developer
Top HR questions asked in Hike Software Developer
Stay ahead in your career. Get AmbitionBox app
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+
Reviews
4 L+
Interviews
4 Cr+
Salaries
1 Cr+
Users/Month
Contribute to help millions
Get AmbitionBox app