Skip to main content

TCS Sample Problems On Odd & Even Integers

Below are three questions on numbers on concepts dealing with odd and even and a new class called "even-odd" numbers.
Question 1
If n is an even-odd number then which of the following must be false?
(A number is called "even-odd" if it is halfway between an even integer and an odd integer.)
a) n/2 is not an integer
b)(2n)2 is an integer
c)4n is an odd integer
d)none of these
Answer : c)4n is an odd integer
Solution:
A number is called "even-odd" if it is halfway between an even integer and an odd integer. For example, consider an even integer 10 and an odd integer -5. Number halfway between them will be (10 - (-5)) / 2 = 7.5. Here 7.5 is an "even-odd" number.
i.e., an even-odd number will be in the form x + 1/2 = x.5 where x is any integer.
Let us see with each option:
Consider option a :
Since n is a fraction number then n/2 is also a fraction.
i.e., n/2 is not an integer.
Hence option a is true.
Consider option b :
(2n)2 = 4n2
since n is an even-odd number then n^2 is not an integer.
Also n2 will have 1/4 = .25 in its decimal place. (For example, consider n = 7/2. Then n2 will be 7/2 x 7/2 = 49/4. 49/4 can be written as 49 + 1/4. Here 1/4 will contribute to the decimal part.)
When we multiply n2 by 4 we have an integer, since .25 x 4 = 1.
Hence option b is true
Consider option c:
We can express 4n as 2 x 2n.
Since n is X.5 then 2n must be an integer and any multiple of 2 gives an even integer.
But the statement says that 4n is an odd integer.
Hence option c is false.
Question 2
If p is an odd number and q is an even number, which of the following must be an even?
I. 2p+3q
II. p2 - q2
III.(pq)2
IV. (1+pq)2
Options:
a) I only b)II&IV only c)I&III only d)I,II&III only
Answer : c)I&III only
Solution:
We know that any multiple of 2 is even and 3 times of an even number is also even.
Then 2p and 3q both are even.
Since the addition of two even numbers is again an even, then 2p+3q is even.
i.e., I is even.
Now, the square of any even number is even and the square of an odd is odd. Then p2 is odd and q2 is even
And difference between even number and odd number is an odd number.
Then p2 - q2 is an odd.
Hence II is odd.
The multiplication of an odd and even number will be an even number, then pq is even,
And the square of an even is even, so (pq)2 is also even.
Hence III is even.
since pq is even, then 1 + pq will be odd.
And the square of odd is odd. Therefore (1 + pq)2 is odd.
Hence IV is odd.
Therefore only I and III are even. Thus the answer is I & III only.
Question 3
If n is an odd integer, then which of the options will be even.
a)(n2)/2 + n b)nn + n + 1 c)(n2 + 3)2 d)none of these
Answer : c)(n2 + 3)2
Solution :
Consider option a,
since n is an odd number then n2 is also an odd
We can express (n2)/2 + n as ( n2 + 2n)/ 2.
And n2 is odd and 2n is even, then n2 + 2n will be odd
Then ( n2 + 2n)/ 2 is not an even integer.
Consider option b,
since n is odd, then n power anything is odd and nn is odd.
The addition of 3 odd numbers is odd, then nn + n + 1 is an odd integer.
Consider option c,
Here n2 is odd and then n2 + 3 is also odd.
Now, the square of an odd integer is odd, then (n2 + 3)2 is an even integer.
Hence the option c)(n2 + 3)2 is the answer.

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

AGRICULTURAL SCIENTIST RECRUITMENT BOARD

Agricultural Research Service National   Eligibility  Test/ Senior Research Fellowship Examination  The Agricultural Scientists Recruitment Board (ASRB)  holds a Competitive Examination for recruiting Scientists of the ARS in the pay scale of Rs. 8,000-13,500 in the ICAR Institutes, combined with National Eligibility Test (NET) for recruitment of Lecturers and Assistant Professors by the State Agricultural Universities (SAUS) and for award of ICAR Senior Research Fellowships. The selected candidates for Agricultural Research Service must serve in the institutes to which they are posted until they find appointment for higher positions through selection at other institutes. (i) Candidates successful in ARS are appointed as Scientists in the Indian Council of Agricultural Research in the pay scale of Rs. 8,000-13,500. (ii) Candidates clearing the National Eligibility Test are recommended to various State Agricultural Universities who will consider them for appointment as Lecturers or A

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)