Skip to main content

Posts

Showing posts with the label Round 1

Pattern 1 | aCoding | Day 1

Problem:   1. You are given a number n. 2. You've to create a pattern of * and separated by tab as shown in output format. Input Format A number n Constraints 1 <= n <= 100 Sample Input 2 Sample Output * * * Solution: import java.util.*; public class Main { public static void main(String[] args) { Scanner scn = new Scanner(System.in); // write ur code here int n = scn.nextInt(); for(int i=1;i<=n;i++){ for(int j=1;j<=i;j++) System.out.print("*\t"); System.out.println(); } } } Follow us for more such content...

Any Base Subtraction | aCoding | Day 16

Problem: 1. You are given a base b. 2. You are given two numbers n1 and n2 of base b. 3. You are required to subtract n1 from n2 and print the value. Input Format A base b A number n1 A number n2 Output Format A number of base b equal in value to n2 - n1. Constraints 2 <= b <= 10 0 <= n1 <= 256 n1 <= n2 <= 256 Sample Input 8 1 100 Sample Output 77 Solution: import java.util.*;      public class Main{      public static void main(String[] args) {       Scanner scn = new Scanner(System.in);       int b = scn.nextInt();       int n1 = scn.nextInt();       int n2 = scn.nextInt();          int d = getDifference(b, n1, n2);       System.out.println(d);    }       public static int getDifference(int b, int n1, int n2){        // write your code here        if(n1<n2){   ...

Any Base Addition | aCoding | Day 15

Problem: 1. You are given a base b. 2. You are given two numbers n1 and n2 of base b. 3. You are required to add the two numbes and print their value in base b. Input Format A base b A number n1 A number n2 Output Format A number representing the sum of n1 and n2 in base b. Constraints 2 <= b <= 10 0 <= n1 <= 256 0 <= n2 <= 256 Sample Input 8 777 1 Sample Output 1000 Solution: import java.util.*;      public class Main{      public static void main(String[] args) {       Scanner scn = new Scanner(System.in);       int b = scn.nextInt();       int n1 = scn.nextInt();       int n2 = scn.nextInt();          int d = getSum(b, n1, n2);       System.out.println(d);    }       public static int getSum(int b, int n1, int n2){        // write ur code here        n1 = convertBase(n1...

Any Base To Any Base | aCoding | Day 14

Problem: 1. You are given a number n. 2. You are given a base b1. n is a number on base b. 3. You are given another base b2. 4. You are required to convert the number n of base b1 to a number in base b2. Input Format A number n A base b1 A base b2 Output Format A number of base b2 equal in value to n of base b1. Constraints 0 <= n <= 512 2 <= b1 <= 10 2 <= b2 <= 10 Sample Input 111001 2 3 Sample Output 2010 Solution: import java.util.*;      public class Main{      public static void main(String[] args) {       Scanner scn = new Scanner(System.in);       int n = scn.nextInt();       int sourceBase = scn.nextInt();       int  destBase= scn.nextInt();              int newN = convertNumber(n,sourceBase,10);       if(destBase != 10)         newN = convertNumber(newN,10,destBase);        ...

Any Base To Decimal | aCoding | Day 13

Problem: 1. You are given a number n. 2. You are given a base b. n is a number on base b. 3. You are required to convert the number n into its corresponding value in decimal number system. Input Format A number n A base b Output Format A decimal number representing corresponding value of n in base b. Constraints 0 <= d <= 1000000000 2 <= b <= 10 Sample Input 111001 2 Sample Output 57 Solution: import java.util.*;      public class Main{      public static void main(String[] args) {       Scanner scn = new Scanner(System.in);       int n = scn.nextInt();       int b = scn.nextInt();       int d = getValueIndecimal(n, b);       System.out.println(d);    }       public static int getValueIndecimal(int n, int b){       // write your code here       int pow = 1,newN = 0;            ...

Decimal To Any Base | aCoding | Day 12

Problem: 1. You are given a decimal number n. 2. You are given a base b. 3. You are required to convert the number n into its corresponding value in base b. Input Format A number n A base b Output Format A number representing corresponding value of n in number system of base b Constraints 0 <= d <= 512 2 <= b <= 10 Sample Input 57 2 Sample Output 111001 Solution: import java.util.*;      public class Main{      public static void main(String[] args) {       Scanner scn = new Scanner(System.in);       int n = scn.nextInt();       int b = scn.nextInt();       int dn = getValueInBase(n, b);       System.out.println(dn);    }       public static int getValueInBase(int n, int b){        // write code here        int pow = 1,newNo = 0;        while(n>0){       ...

Digit Frequency | aCoding | Day 11

Problem:  1. You are given a number n. 2. You are given a digit d. 3. You are required to calculate the frequency of digit d in number n. Input Format A number n A digit d Output Format A number representing frequency of digit d in number n. Constraints 0 <= n <= 10^9 0 <= d <= 9 Sample Input 994543234 4 Sample Output 3 Solution: import java.util.*; public class Main {     public static void main(String[] args) {         Scanner scn = new Scanner(System.in);         int n = scn.nextInt();         int d = scn.nextInt();         int f = getDigitFrequency(n, d);         System.out.println(f);     }     public static int getDigitFrequency(int n, int d) {         // write code here         int count = 0;         while(n > 0){             if((n%10)==d) ...

Pattern 2 | aCoding | Day 2

Problem: 1. You are given a number n. 2. You've to create a pattern of * and separated by tab as shown in output format. Constraints 1 <= n <= 100 Sample Input 5 Sample Output * * * * * * * * * * * * * * * Solution: import java.util.*; public class Main {     public static void main(String[] args) {         Scanner scn = new Scanner(System.in);         // write ur code here         int n=scn.nextInt();         for(int i=n;i>0;i--){             for(int j=i;j>0;j--)                 System.out.print("*\t");             System.out.println();         }     } }

DU Admission & Cutoff 2020

The University of Delhi  will soon announce DU Cut Off for Arts, Science, and Commerce. DU and all its affiliated colleges release subject wise cut off list for DU admission 2020. Candidates can check it from du.ac.in or this page.  The DU admission cutoff 2020 will be available via online mode.  The candidates can check the cutoff of DU admission 2020 to know the minimum marks required to appear for admission process of the university. The officials will consider the best of four score of the aspirants to provide admission in the institute. Latest: DU Admission FAQs 2020-21 The officials will consider the marks of the candidates in the qualifying examination for admission i.e. admission is based on the class 12th performance. The DU 2020 cutoff will be prepared based on the number of factors including availability of seats, difficulty level of the paper etc.  Each participating college will release an individual cutoff.  Important Dates: DU Application Starts ...

JoSAA counselling 2019 (Round 1 Result Announced)

Exclusive:  JoSAA Counselling 2021, Documents Required  | Click here JoSAA counselling 2019 first round result... The Joint Seat Allocation Authority (JoSAA)  has released the seat allotment list for Round-1 on its website. Candidates who have successfully qualified the JEE Main and JEE Advanced examination and applied for the counselling process can now visit the official website of the authority to check the Round 1 allotment list. It may be noted that the candidates are required to enter their JEE Main Application number, password and security pin in the seat allotment link for accessing the entire list. Candidates who find their name in the JoSAA seat allotment list Round-1 will have to confirm their admissions to IITs, NITs, IIEST, IIITs, and GFTIs, which have been allotted to them. As per the official notification released by JoSAA regarding the counselling procedure, all those candidates who qualify for the JoSAA round 1 seat allotment will need to app...

JoSAA 2019 Round 1 seat allotment result

JoSAA 2019 Round 1 seat allotment result declared... JOSAA round 1 seat allotment result 2019 has been announced and is now will be available to be checked by the candidates on the official website josaa.nic.in. JOSAA schedule, important dates, opening and closing ranks are given below. Closing and opening rank and seat allotment statistics Top 20 Percentile for IITs Top 20 percentile for NITs, IIITs and other GFTIs J oSAA 2019:  The first round of seat allotment has been be published on  June 27 by the Joint Seat Allocation Authority (JoSAA) 2019. The students can check the seat allotment through the official website,   josaa.nic.in  for admission into IITs, NITs, IITs and other GFTIs. About 36,000 seats are available in 23 Indian Institute of Technology (IITs), 31 National Institute of Technology (NITs), 23 Indian Institute of Information Technology (IIITs) and 20 government funded technical institutions (GFTIs) are offering admissions to the student...