LEARN KOTLIN QUICKLY AND PYTHON CODING PRACTICE EXERCISES: Coding For Beginners by TAM JJ

LEARN KOTLIN QUICKLY AND PYTHON CODING PRACTICE EXERCISES: Coding For Beginners by TAM JJ

Author:TAM, JJ [TAM, JJ]
Language: eng
Format: epub
Published: 2021-07-11T00:00:00+00:00


var marks: Int = 65

if (marks < 35 )

println( "You are failed" );

else if (marks < 50 )

println( "You are passed and got third class" );

else if (marks < 60 )

println( "You are passed and got second class" );

else if (marks < 70 )

println( "You are passed and got first class" );

else

println ( "You are passed and got distinction" );

}

Output

You are passed and got first class

You can implement above if-else if-else logic using when expression like below.

WhenDemo.kt



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.