Friday 13 September 2013

Infosys Aspiration 2020- Practice Session

Question 1:

A string (example "I am writing an email") is entered through the keyboard, write a program in C to get its reverse in a column as output i.e.:
email
an
writing
am
I

Question 2:

A vampire number has an even number of digits and is formed by multiplying a pair of numbers containing half the number of digits of the result. The digits are taken from the original number in any order. Pairs of trailing zeroes are not allowed. Example include:
1260 = 21 * 60
1827 = 21 * 87
2187 = 27 * 81

Question 3:

Anagram is a  word that is spelled with the exact same letters as another word. Example: RIDES is an anagram of SIRED and vice versa.

Question 4:
We will call a positive integer "nasty" if it has at least two pairs of positive integer factors such that the difference of one pair equals the sum of the other pair.For example, 6 is nasty since 6 x 1 = 6, 2 x 3 = 6, 6 - 1 = 2 + 3; and 24 is also nasty since 12 - 2 = 6 + 4.Debug a program which accepts as input a list of positive integers and determines if each one is nasty or not.

No comments:

Post a Comment