Skip to main content

Posts

Showing posts with the label Coding

TCS Coding Questions

  Coding Q1 : M is an expert in Mathematics. He is performing arithmetic operations and wants to find all the divisors of P number. Note: Divisors should be separated by space and increasing order should be maintained. Input format Input containing a non-negative integer ‘P’ denoting the number Violation of input criteria: System should display message as “Wrong Input” Output Format All divisors should be separated by space and increasing order must be maintained Constraints 1 <= P <= 10^8 Sample 1 Input 10 Output 1 2 5 10   Q2: Alex has been preparing a box for handicraft. The box consists of N pieces of stones with each stone having a certain weight assigned to it. Each stone in the box will carry a different weight. This means no two stones can have the same weight Alex wants to do this by making minimal changes in the original weight at least as much as its original weight Find the minimum total weight that he can set for the box...