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
4mo

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!
Select
Add answer anonymously...

Hike Software Developer interview questions & answers

A Software Developer was asked Q. Given an array of integers representing the heights of bars in a histogram, find...read more
A Software Developer was asked Q. Statistics From A Large Sample Task Calculate various statistical measures given...read more
A Software Developer was asked Q. Pair Sum in Binary Search Tree Given a Binary Search Tree (BST) and a target val...read more

Popular interview questions of Software Developer

A Software Developer was asked Q1. Given an array of integers representing the heights of bars in a histogram, find...read more
A Software Developer was asked Q2. Statistics From A Large Sample Task Calculate various statistical measures given...read more
A Software Developer was asked Q3. Pair Sum in Binary Search Tree Given a Binary Search Tree (BST) and a target val...read more
Hike Software Developer Interview Questions
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+

Reviews

10L+

Interviews

4 Cr+

Salaries

1.5 Cr+

Users

Contribute to help millions

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

Follow Us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter
Profile Image
Hello, Guest
AmbitionBox Employee Choice Awards 2025
Winners announced!
awards-icon
Contribute to help millions!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
Add office benefits
Add office benefits