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.

Be the first one to answer
Add answer anonymously...
Hike Software Developer Interview Questions
Stay ahead in your career. Get AmbitionBox app
qr-code
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

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter