TypeScript bootcamp · Lab 04

Largest of three

easyIf Else10 minLesson: If Else

Read the question, write TypeScript on the right, then Run or Check.

QuestionHint and solution stay closed until you open them

Read three numbers. Log the largest.

Examples

Example 1
Input
3
9
4
Output
9
Example 2
Input
5
5
2
Output
5
Hint
  1. Math.max(a, b, c)
Show correct code

Peek only after you have tried. You can still Check your own version.

const a: number = Number(readLine());
const b: number = Number(readLine());
const c: number = Number(readLine());
console.log(Math.max(a, b, c));
main.tstsc · readLine() · Ctrl + Enter
ResultIdle
Run to see output. Check grades the tests.