Largest of Two Distinct Numbers Without Conditional Statements or Operators

Rinish Patidar
Updated on 14-Mar-2023 14:33:44

2K+ Views

In this problem set, we will be given any two distinct positive numbers, let’s say a and b, we need to return the largest of two distinct numbers without using any conditional statements (if-else) or any operators(, ==, !=, etc.) in c++. The main difficulty of the problem includes that we need to determine the largest of any two distinct positive numbers without using any operators or conditional statements. For example, INPUT: x=12, y=20 OUTPUT: 20 INPUT: x=3, y=2 OUTPUT: 3 Below is the algorithm that we will be using to solve this problem. Algorithm We will use type casting ... Read More

Find the Smallest Positive Number Missing from an Unsorted Array

Rinish Patidar
Updated on 14-Mar-2023 14:31:04

3K+ Views

Our objective is to find the smallest positive number that is missing from an unsorted array. We will be given an array a[] of both positive and negative numbers, we need to get the smallest positive number that is missing from an unsorted array in this problem. We can modify the array given in this problem to solve it. For example, INPUT : a[] = {5, 8, -13, 0, 18, 1, 3} OUTPUT : 2 INPUT : a[] = {7, 10, -8, 1, 4} OUTPUT : 2 In the above examples, we are given an unsorted array as an input. ... Read More

Divide Two Integers Without Using Multiplication, Division, and Mod Operator

Rinish Patidar
Updated on 14-Mar-2023 14:24:05

5K+ Views

In this problem, we simply need to divide two integers without using multiplication, division and mod operator. Though we can use addition or multiplication or bit manipulation. The problem statement states that we will be given two integers x and y. Without using multiplication, division or mod operator, we need to determine the quotient after dividing x by y. Example INPUT: x=15 , y=5 OUTPUT: 3 INPUT: x=10 , y=4 OUTPUT: 2 INPUT: x=-20 , y=3 OUTPUT: -6 Approach Approach-1(using simple mathematics) In this approach, we will use a simple mathematics algorithm. Below is the step-by-step illustration of the ... Read More

Centered Dodecagonal Number

Rinish Patidar
Updated on 14-Mar-2023 14:07:38

246 Views

A figurative number that depicts a dodecagon is called a dodecagonal number. The Centered Dodecagonal number is represented by a dot in the centre and other dots encircling it in the successive dodecagonal (i.e. a 12-sided polygon) layers. Centered Dodecagonal number can be better explained with the below figure. For n=1, only a single dot will be there in the centre. So the output will be 1. For n=2, a single dot in the centre followed by a dodecagon encircling it. Thus, the total number of dots will be 13. So the next centred dodecagonal number ... Read More

Audio Manager in Android

Vaibhav Ahire
Updated on 14-Mar-2023 13:42:28

840 Views

What is an audio manager in android? Audio Manager the name itself suggests to us that it is used to manage the audio profile within the android application. This is generally used to switch between different audio modes for android devices such as ringer mode, silent mode and vibrate mode. Implementation of Audio Manager We will be creating a simple application in which we will be simply displaying 3 buttons and 2 text views. The 3 buttons inside our android application are used to switch between different audio modes such as Ringer mode, silent mode and vibrate mode. We will ... Read More

Android Toast in Kotlin

Vaibhav Ahire
Updated on 14-Mar-2023 13:41:17

2K+ Views

Introduction In this article, we are going to learn on How to display toast messages in our android application using Kotlin as a programming language. What is toast in android? Toast in android is a type of short notification which is displayed to the user without disturbing the other functionalities of the application. This notification is generally displayed in the floating manner at the bottom center part of the android application. This type of notification is generally displayed for a very short period of time which may vary from 3 to 4 seconds depending on the type of toast message ... Read More

Android SDK and Its Components

Vaibhav Ahire
Updated on 14-Mar-2023 13:38:21

12K+ Views

Introduction Android SDK(Software Development Kit) is a set of development tools which is required when building any android application. Android SDK consists of several components within it such as − SDK Platforms. SDK Tools. SDK Update Sites. Android Emulator. In this article, we will take a look at What is Android SDK and what are the different components which are present in the Android SDK. Android SDK It is a collection of software development tools and libraries which are required for building any android application in any IDE whether it may be android studio, eclipse ... Read More

Android Motion Layout in Kotlin

Vaibhav Ahire
Updated on 14-Mar-2023 13:36:12

872 Views

What is Motion Layout in Android? Motion Layout is a child class of Constraint Layout in Android. It inherits properties from Constraint Layout. This layout is used to manage motion and layout animations for the widgets within the android application. Motion Layout is used to provide gesture control animations such as wipe down, swipe up and other types of motions within our android application. Implementation of Motion Layout in Kotlin We will be creating a simple application in which we will be simply displaying two text views. We will be adding these text views within our Motion Layout and adding ... Read More

AdMob Interstitial Ads in Android

Vaibhav Ahire
Updated on 14-Mar-2023 13:30:56

3K+ Views

What are Admob Banner Ads in Android? Admob is a Google mediation platform. We can use this to display advertisements within our android application. Along with that we can earn money by displaying the ads within our application. There are different types of ads which we can display within our application. In this article we will take a look on How to display Admob Interstitial ads within our android application. Implementation of Admob Interstitial Ads in Android We will be creating a simple application in which we will be simply displaying a text view and a button. After clicking that ... Read More

AdMob Banner Ads in Android

Vaibhav Ahire
Updated on 14-Mar-2023 13:29:33

3K+ Views

What are Admob Banner Ads in Android? Admob is a Google mediation platform. We can use this to display advertisements within our android application. Along with that we can earn money by displaying the ads within our application. There are different types of ads which we can display within our application. In this article we will take a look on How to display Admob Banner ads within our android application. Implementation of Admob Banner Ads in Android We will be creating a simple application in which we will be simply displaying a text view and an Admob AdView. Using this ... Read More

Advertisements