Posts

Android Studio - how to make phone call

Image
Hello Everyone, Today, we are going to see how to make phone calls from your android application. Just an EditText and a Button. In the EditText you can give any phone number and click the Button, it will make the call to that number. Let's see, Output Just copy and paste the below code, run it and enjoy it activity_main.xml               < ? xml version = "1.0" encoding = "utf-8" ? > < android . support . constraint . ConstraintLayout xmlns:android = "http://schemas.android.com/apk/res/android" xmlns:app = "http://schemas.android.com/apk/res-auto" xmlns:tools = "http://schemas.android.com/tools" android:layout_width = "match_parent" android:layout_height = "match_parent" tools:context = "com.example.dhevendhiran.phonecall.MainActivity" > < Button android: id = "@+id/buttonCall" android:layout_wid

Seating Arrangement Problem - HackerEarth

Image
SOLUTION FOR SEATING ARRANGEMENT PROBLEM - HACKEREARTH PROBLEM Akash  and  Vishal  are quite fond of travelling. They mostly travel by railways. They were travelling in a train one day and they got interested in the seating arrangement of their compartment. The compartment looked something like  So they got interested to know the seat number facing them and the seat type facing them. The seats are denoted as follows :  Window Seat :  WS Middle Seat :  MS Aisle Seat :  AS You will be given a seat number, find out the seat number facing you and the seat type, i.e.  WS ,  MS  or  AS . INPUT First line of input will consist of a single integer  T  denoting number of test-cases. Each test-case consists of a single integer  N  denoting the seat-number. OUTPUT For each test case, print the facing seat-number and the seat-type, separated by a single space in a new line. CONSTRAINTS 1<= T <=10 5 1<= N <=108 SAMPLE INPUT 2 18 40 SAM