Kytcs: Placementpaper -->
Showing posts with label Placementpaper. Show all posts
Showing posts with label Placementpaper. Show all posts

Hcf and Lcm

HCF


What is HCF?

HCF means the largest number that divides two or more numbers exactly (without leaving any remainder).
It is also called GCD (Greatest Common Divisor).


Methods to Find HCF

1. Factor Method

Write all factors of given numbers

Find the greatest common factor

Example:

HCF of 8 and 12 = 4


2. Prime Factorization Method

Break numbers into prime factors.

Example:

18 = 2 × 3 × 3

24 = 2 × 2 × 2 × 3

Common primes → 2 × 3

 HCF = 6


3. Division Method

Divide the larger number by the smaller

Continue until remainder becomes 0

Last divisor is the HCF

Example:

HCF of 36 and 12 = 12



Important Points for Exams 


  1. HCF of two prime numbers = 1
  2. HCF of a number with itself = same number
  3. HCF of consecutive numbers = 1
  4. HCF of even and odd number = 1

Formula to Calculate HCF



 HCF × LCM = Product of the two numbers

HCF = product of the two numbers/LCM


DOTNET

Welcome to the my blog




            Course        
             
                HTML-5  
 
         
                  CSS

              javascript  

                 OpsRio


javascript


Welcome to the my blog






































Java Movie Management

Welcome to the my blog



Java Movie Management








import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;

public class Solution {
   public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        Movie[] mv = new Movie[4];
        for(int i=0;i<4;i++)
        {
            int a = sc.nextInt();sc.nextLine();
            String b = sc.nextLine();
            int c = sc.nextInt();
            int d = sc.nextInt();
            mv[i] = new Movie(a,b,c,d);
        }
        sc.nextLine();
        String nm = sc.nextLine();
        int um = sc.nextInt();
        int dm = sc.nextInt();
        int res = findAvgBudgetByDirector(mv, nm);
        if (res>0)
        System.out.println(res);
        else
        System.out.println("Sorry - The given director has not yet directed any movie");
        Movie temp = getMovieByRatingBudget(mv, um, dm);
        if(temp == null)
        System.out.println("Sorry - No movie is available with the specified rating and budget requirement");
        else
        System.out.println(temp.id);

    }

    public static int findAvgBudgetByDirector (Movie[] mv, String nm)
      {
          //method logic
          int avg,s=0,j=0;
          for(int i=0;i<4;i++)
          {              
              if(nm.equalsIgnoreCase(mv[i].dt))
              {
                  s = s+mv[i].bt;
                  j++;
              }
          }
              if(j>0)
              {
                  avg = s/j;
                  return avg;
              }          
              else 
              return 0;
      }

    public static Movie getMovieByRatingBudget(Movie[] mv, int rating, int budget)
      {
          //method logic
          Movie temp = new Movie();
          for(int i=0;i<4;i++)
          {
              if((rating == mv[i].rt) && (budget == mv[i].bt) && (mv[i].bt % mv[i].rt == 0))
              {
                  temp.id = mv[i].id;
                  return temp;
              }
          }
          return null;   
          
      }
}

class Movie
{
    //code to build Movie class
    int id,rt,bt;
    String dt;
    Movie()
    {

    }
    Movie(int id, String dt, int rt, int bt)
    {
        this.id = id;
        this.dt = dt;
        this.rt = rt;
        this.bt = bt;
    }
}

Unix code

Welcome to the my blog
OPA -JAVA UNIX Student details


#!/bin/bash
read 
awk 'BEGIN{FS=",";t=0}
 {
a[t]=$1;
b[t]=$3+$4;
c[t]=$2;
 
t=t+1
 
}
END
{
for(i=0;i<t;++i)
{
   ma=0;
    pos=i;
    for(j=0;j<t;++j)
    {
        if (b[j]>ma)
        {
            ma=b[j];
            pos=j;
        }
    }
    if (b[pos]>99)
    print a[pos],c[pos];
    b[pos]=-1;
 
}
}
'

Infosys Placement Papers Syllabus

Infosys Placement Papers Syllabus 2019

Infosys previous year papers give a gist of the syllabus from which most of the questions in the drive would be asked. The syllabus gives a good idea of what topics should be prepared.

Infosys Quantitative Aptitude Questions


The syllabus for Infosys quantitative aptitude section is as follows:
  • Percentages
  • Profit and Loss
  • Permutation and Combination
  • Probability
  • Speed Time and Distance
  • Boats and Streams
  • Time and Work
  • Data Interpretation
  • Mixtures and Allegation

Followers

Ad Space