Skip to main content

Wipro Sample Algebraic Problems

Below are three model problems dealing with the formulae (x+y)2 = x2 + y2 + 2xy and (x-y)2 = x2 + y2 - 2xy
Question 1
Find X when X - Y = 3 and X2 + Y2 = 89 where X and Y are integers.
a)10 b)-5 c)-10 d)-3
Answer : b)-5.
Solution :
We know that (x - y)2 = x2 + y2 - 2xy
Sub. the given values,
32 = 89 - 2XY
9 - 89 = -2XY
80 = 2XY
XY = 40
Since X and Y are integers and XY = 40,the possibilities of X and Y are as follows:
(1,40), (2,20), (4,10), (5,8), (-1,-40), (-2,-20), (-4,-10) and (-5,-8)
X - Y is a positive integer(3), so X will be greater than Y.
By checking the given condition X - Y = 3, we have X = 8, Y = 5 or X = -5, Y = -8.
i.e., X is either 8 or -5.
From the given options we can conclude that X = -5.
Question 2
If the summation and multiplication of two integer is 24 and 143 respectively then the difference of them is:
a)2 b)1 c)12 d)4
Answer : a)2
Solution :
Let A and B be two integers.
Then A + B = 24 and AB = 143.
We know that (x+y)2 = x2 + y2 + 2xy
Here, 242 = A2 + B2 + 2(143)
576 - 286 = A2 + B2
A2 + B2 = 290.
i.e., Summation of the square of two integers is 290.
i.e., A2 or B2 is < or = 290.
Since A and B are integers, the possibilities are {1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 256, 289}.
From the above set of square numbers, the values may be
A2 + B2 = 1 + 289 or 121 + 169 = 290
A2 + B2 = 12 + 172 or 112 + 132 = 290
The condition A + B = 24 and AB = 143, is satisfied by A = 11, B = 13 or A = 13, B = 11
We have to find the difference of A and B.
Hence the difference is 2.
Question 3
If X - Y = 9, X2 + Y2 = 257 and X,Y are integers then what will be the value of X and Y ?
a)21,12 b)15,6 c)none of these d)cannot be determined
Answer : d)cannot be determined
Solution :
Here we use the formula, (x-y)2 = x2 + y2 - 2xy
92 = 257 - 2XY
XY = (257-81)/2 = 176/2 = 88
XY = 88
Since X and Y are integers and XY = 88 then the possibilities of X and Y are (1,88), (2,44), (4,22), (8,11), (-1,-88), (-2,-44), (-4,-22) and (-8,-11).
By observing, none of the above possibility of X and Y satisfies X - Y = 9.
Hence, the values of X and Y cannot be determined by given conditions.

Comments

Popular posts from this blog

CIVIL SERVICES' (I.A.S.) EXAMINATION

The Union Public Service Commission (U.P.S.C.)  conducts Civil Services' Examination once a year in two stages. The Preliminary Examination (Objective Type) for selection of candidates for the Main Examination is held in the month of May. The Civil Services Main Examination  is held in the months of October/November. Blank application forms and other particulars are published in the Employment News, generally in the month of December. The last date for the submission of applications to the Secretary, Union Public Service Commission, Dholpur House, Shahjahan Road, NewDelhi-11001 1 is usually the last week of January of the year of examination. The Combined Civil Services Examination is conducted for Recruitment to the following Services/Posts: 1. Indian Administrative Service. 2. Indian Foreign Service. 3. Indian Police Service. 4. Indian P & T Accounts & Finance Service, Group 'A'. 5. Indian Audit and Accounts Service, Group 'A'. 6. Indian Customs and Centr...

Predict the output or error(s) for the following:

1 . void main(){ int const * p=5; printf("%d",++(*p)); } Answer: Compiler error: Cannot modify a constant value. Explanation: p is a pointer to a "constant integer". But we tried tochange the value of the "constant integer". 2. main() {  char s[ ]="man"; int i;  for(i=0;s[ i ];i++) printf("\n%c%c%c%c",s[i],*(s+i),*(i+s),i[s]); } Answer: mmmm aaaa nnnn Explanation: s[i], *(i+s), *(s+i), i[s] are all different ways of expressing the same idea. Generally array name is the base address for that array. Here s is the base address. i is the index number/displacement from the base address. So, indirecting it with * is same as s[i]. i[s] may be surprising. But in the case of C it is same as s[i]. 3 . main(){  float me = 1.1;  double you = 1.1;  if(me==you) printf("I love U"); else printf("I hate U"); } Answer: I hate U Explanation : For floating point numbers (float, double, long double) ...

How do I "get" a null pointer in my programs?

Answer : According to the language definition, a constant 0 in a pointer context is converted into a null pointer at compile time. That is, in an initialization, assignment, or comparison when one side is a variable or expression of pointer type, the compiler can tell that a constant 0 on the other side requests a null pointer, and generate the correctly-typed null pointer value. Therefore, the following fragments are perfectly legal: char *p = 0; if(p != 0) However, an argument being passed to a function is not necessarily recognizable as a pointer context, and the compiler may not be able to tell that an unadorned 0 "means" a null pointer. For instance, the Unix system call "execl" takes a variable-length, null-pointer-terminated list of character pointer arguments. To generate a null pointer in a function call context, an explicit cast is typically required: execl("/bin/sh", "sh", "-c", "ls", (char *)0); If the (c...