kotlin

How to remove specific elements from an array using index in Kotlin

Learn how to remove specific elements from an array by using its index in Kotlin. We have to convert the array to a MutableList first and then convert it back to an array.

Read
kotlin

2 ways to find the average of array numbers in kotlin

Learn how to find the average of numbers of an array in Kotlin in two different ways. We can either iterate over the elements of the array or we can use the average function to find the average of numbers of an array.

Read
kotlin

5 ways to swap two numbers in Kotlin

Learn how to swap two numbers in Kotlin in different ways. We will learn how to swap the numbers by using a third variable, without using a third variable, using also, with and apply scope functions.

Read
kotlin

4 ways to print an integer entered by the user in Kotlin

Learn how to print an integer entered by the user in Kotlin. We will learn 4 ways to do that, by using the Scanner class, by using the readLine method, with readln method and by using readlnOrNull method.

Read
kotlin

How to print Hello World in Kotlin in IntelliJ-Idea

Learn how to print Hello World in Kotlin. We will learn how to create a project, how to create Kotlin files and how to run a program that print Hello World in Kotlin.

Read
kotlin

2 ways in Kotlin to check if a year is a leap year or not

Learn how to check if a year is a leap year or not in Kotlin in two different ways. We will learn how to check for leap year by using a if-else block and by using when block in Kotlin.

Read
kotlin

4 different Kotlin programs to add two numbers

4 different Kotlin programs to add two numbers. We will learn examples with predefined values, with user inputs, with floating point numbers and how to add N numbers.

Read
c

3 different C programs to find all prime numbers in a range

C program to find all prime numbers in a range. We will learn 3 different ways to find all prime numbers in a given range of 1 to N.

Read
c

4 different C programs to check if a number is prime or not

C program to check if a number is prime or not in 4 different ways. The program will take one number as input from the user and print if it is a prime number or not.

Read
c

2 different C programs to print a triangle of prime numbers

C program to print a triangle of prime numbers. This program will take the height of the triangle as input from the user and print it out. We will learn how to use for loops and while loops to print the triangle.

Read