Needs remove the node pointed the and adjust the head
Sorry for the delay.
To clear the HCL TECHNOLOGIES written test, all u have to do is use BASIC LOGIC.
C programming
Flowchart analysis
Aptitude.
1. a=2, b=3, c=6 Find the value of c/(a+b)-(a+b)/c
Ans. 11/30
2. What does the hexa number E78 in radix 7.
(a) 12455
(b) 14153
(c) 14256
(d) 13541
(e) 131112
Questions 6 - 10 are to be answered on the following data
A causes B or C, but not both
F occurs only if B occurs
D occurs if B or C occurs
E occurs only if C occurs
J occurs only if E or F occurs
D causes G,H or both
H occurs if E
occurs
G occurs if F occurs
6. If A occurs which of the following must occurs
I. F and G
II. E and H
III. D
(a) I only
(b) II only
(c) III only
(d) I,II, & III
(e) I & II (or) II & III but not both
11. Given that A,B,C,D,E each represent one of the digits between 1
and 9 and that the following
multiplication holds:
A B C D E
X 4
--------------
E D C B A
-------------- what digit does E represent ?
a) 4
b) 6
c)
8
d) 7
16. If one of the two parties of knights consists of P and U and two
other knights and travels by the southern route,
the other members of this party besides P and U must be
a) Q and S
b) Q and
T
c) R and S
d) R and T
e) S and T
17. If each of the two parties of knights consists of exactly three
members, which of the following is not a possible travelling party and
route?
a) P,S,U by the northern route
b) P,S,T by the northern route
c) P,S,T by the southern route
d) P,S,U by the southern route
e) Q,R,T by the southern route
e) T
C Programming
int x= 0x65;
main()
{
char x;
printf("%d\n",x)
}
a) compilation error b) 'A' c) 65 d)
unidentified
4. What is the output of the following program
main()
{
int a=10;
int b=6;
if(a=3)
b++;
printf("%d %d\n",a,b++);
}
a) 10,6 b)10,7 c) 3,6 d) 3,7 e) none
5. What can be said of the following program?
main()
{
enum Months {JAN =1,FEB,MAR,APR};
Months X = JAN;
if(X==1)
{
printf("Jan is the first
month");
}
}
a) Does not print anything
b) Prints : Jan is the first month
c) Generates compilation error
d) Results in runtime error
6. What is the output of the following program?
main()
{
int l=6;
switch(l)
{ default : l+=2;
case 4: l=4;
case 5: l++;
break;
}
printf("%d",l);
}
a)8 b)6 c)5 d)4 e)none
1. Which of the following involves context switch,
(a) system call
(b) priviliged instruction
(c) floating poitnt exception
(d) all the above
(e) none of the above
2. In OST, terminal emulation is done
in
(a) sessions layer
(b) application layer
(c) presentation layer
(d) transport layer
A 177333(conversion of HEX "0xFEDB"in octal)
In signed magnitude notation what is the minimum value that can be represented with 8 bits
(a) -128
(b) -255
(c) -127
(d) 0
They make u really comfortable.
Be well versed with ur project.
HR Interview:
This was not the regular kinda HR round.
Aptitude.
1. a=2, b=3, c=6 Find the value of c/(a+b)-(a+b)/c
Ans. 11/30
2. What does the hexa number E78 in radix 7.
(a) 12455
(b) 14153
(c) 14256
(d) 13541
(e) 131112
Ans. (d)6. If A occurs which of the following must occurs
I. F and G
II. E and H
III. D
(a) I only
(b) II only
(c) III only
(d) I,II, & III
(e) I & II (or) II & III but not both
Ans. (e)7. If B occurs which must occur
(a) D
(b) D and G
(c) G and H
(d) F and G
(e) J
Ans. (a)12. Working independently, Tina can do a certain job in 12 hours. Working independently, Ann can do
the same job in 9 hours. If Tina Works independently at the job for 8 hours and then Ann works
independently, how many hours will it take Ann to complete the remainder of the jobs?
(A)2/3 (B)3/4 (C)1 (D)2 (E)3
Answer :E)313. In a murder case there are four suspects P,Q,R,S. Each of them makes a statement. They are p:
"I had gone to the theatre with S at the time of the murder".q: "I was playing cards with P at the time
of the murder".r: "Q didn't commit the murder".s: "R is not the murderer".Assuming the only one of the
above statement is false and that one of them is the murderer, who is the murderer?
a) P
b) Q
c) R
d) Cann't be concluded
e) S
Ans: E18. If a=2,b=4,c=5 then
a+b c
- ---- =
c a+b
a) 1
b) 11/30
c) 0
d) -11/30
e) -1
Ans: b19. 10^2(10^8+10^8) =-------------- 10^4
a) 2(10)^4
b) 2(10)^6
c) 10^8
d) 2(10)^8
e) 10^10
Ans: b23) If one of the two parties of knights consists of U and two other knights and travels by the northern route, the
other memnbers of this party besides U must be
a) P and S
b) P and T
c) Q and R
d) Q and T
e) R and T
Ans: c24) If each of the two parties of knights consists of exactly three members of different parties, and R travels by the
northern route,then T must travel by the
a) southern route with P and S
b) southern route with Q and R
c) southern route with R and U
d) northern route with Q and R
e) northern route with R and U
Ans: a31. A sink has 12 lits of water some quantity of water is taken out. if the remainng water is 6 litres less then the
water taken out then quantity of water taken out is.
a.3
b.6
c.9
d.1
32 .which is the 4 digit number whose second digit is thrice the first digit and 3'rd digit is sum of 1'st and 2'nd and
last digit is twice the second digit.
1.2674
2.1349.
3.3343
4.3678
33. In a straight highway 2 cars starts from the same point in opposite directions each travels for 8 Kms and take
left turn then travel for 6 Kms what is the distance between them now.
1.16
2.20
3.25
4.10
34. A problem based on house numbers.
35. Five students compare their test and quiz marks.some datas given.5 questions based on this.C Programming
1. Which of the following about the following two declaration is true
i ) int *F()
ii) int (*F)()
Choice :
a) Both are identical
b) The first is a correct declaration and the second is wrong
c) The first declaraion is a function returning a pointer to an integer and the second is a pointer to function returning
int
d) Both are different ways of declarin pointer to a function Answer : c) The first de...3. A computer routine was developed to generate two numbers (x,y) the first being a random number between
0 and 100 inclusive, and the second being less than or equal to the square root of the first. Each of the following
pair satisfies the routine EXCEPT
(A) (99.10) (B) (85.9) (C) (50.7) (D) (1.1) (E) (1.0)
Answer : A) (99.10)4. A warehouse had a square floor with area 10,000 sq.meters. A rectangular addition was built along one entire side
of the warehouse that increased the floor by one-half as much as the original floor. How many meters did the
addition extend beyond the original buildings ?
(A)10 (B)20 (C)50 (D)200 (E)500
Ans: c)508. A merchant sells an item at a 20 percent discount. but still makes a gross profit of 20 percent of the cost.
What percent of cost would be gross profit on the item have been if it had been sold without the discount?
(A)20% (B)40% (C)50% (D)60% (E)66.6%
Ansr :c) 50%9. A millionaire bought a job lot of hats 1/4 of which were brown. The millionaire sold 2/3 of the hats including
4/5 of the brown hats. What fraction of the unsold hats were brown.
(A)1/60 (B)1/15 (C)3/20 (D)3/5 (E)3/4
Ans :c)3/2014. A decorator bought a bolt of d m number of red chips in any one stack ?
(A) 7 (B) 6 (C) 5 (D) 4 (E) 3
Ans :C) 515. A sink has 12 lits of water some quantity of water is taken out. if the remainng water is 6 litres less then the
water taken out then quantity of water taken out is.
a. 3
b. 6
c. 9
d. 1
16. which is the 4 digit number whose second digit is thrice the first digit and 3'rd digit is sum of 1'st and 2'nd and
last digit is twice the second digit.
1.2674
2.1349.
3.3343
4.3678
17. In a straight highway 2 cars starts from the same point in opposite directions each travels for 8 Kms and take
left turn then travel for 6 Kms what is the distance between them now.
1.16
2.20
3.25
4.10
4.A problem based on house numbers.
18. Five students compare their test and quiz marks. some datas given. 5 questions based on this.3. For a 25MHz processor , what is the time taken by the instruction which needs 3 clock cycles,
(a)120 nano secs
(b)120 micro secs
(c)75 nano secs
(d)75 micro secs4. For 1 MB memory, the number of address lines required,
(a)11
(b)16
(c)22
(d) 24
Ans. (b)12. Piggy backing is a technique for
a) Flow control
b) Sequence
c) Acknowledgement
d) retransmition
Ans. (c)13. In signed magnitude notation what is the minimum value that can be represented with 8 bits
(a) -128
(b) -255
(c) -127
(d) 03. Find the output for the following C program
fn f(x)
{ if(x<=0)
return;
else f(x-1)+x;
}4. Find the output for the following C program
i=20,k=0;
for(j=1;j<i;j=1+4*(i/j))
{k+=j<10?4:3;
}
printf("%d", k);
Ans. k=49. What is the sizeof(long int)
(a) 4 bytes
(b) 2 bytes
(c) compiler dependent
(d) 8 bytes10. Which of the function operator cannot be over loaded
(a) <=
(b) ?:
(c) =
(d) *2. What is the output of the following program
main()
{ int var=25,varp;
varp=&var;
varp p = 10;
fnc(varp)
printf("%d%d,var,varp);
}
(a) 20,55
(b) 35,35
(c) 25,25
(d)55,55
3. Here is the structure declaration of a doubly linked list
struct dlink {
int nodeid;
struct dlink *next;
struct dlink *prev;
} dlink_t;
A pointer of the head of the linked list is maintained as a global variable, whose definition is dlink_t *head; The funtion
remove_element(dlink_t *rp), needs to remove the node pointed to the rp and adjust the head. The first node's prev
and the last node's next are NULL. remove_element(dlink_t *rp)
{
rp->prev->next = rp->next;
rp->next->prev = rp->prev;
if( head == rp)
head = rp->next;} Which of the following statement is true about the fution remove_element
a) It work when head is the same as rp
b) It does not work when rp is the last element on the list
c) It sets the head of the list correctly
d) It works in all cases
Answer :B) It does...
4. Consider the following function written in c:
#define NULL 0
char *
index(sp,c)
register char *sp,c;
{
do {
if(*sp == c)
return (sp);
} while (*sp++);
return NULL;
}
The first argument sp, is a pointer to a C string. The second argument, c, is a character. This function scarches
for the character c, in the string. If it is found a pointer to that location is returned else NULL is returned. This
function works
a) Always
b) Always, but fails when the first byte contais the character c
c) works when c is a non NULL character only
d) Works only when the character c is found in the string
ans: a
5. What is printed when this program is executed
main()
{
printf ("%d\n",f(7));
}
f(X)
{
if ( <= 4)
return x;
return f(--x);
}
a) 4
b) 5
c) 6
d) 7
ans: a
6. On a machine where pointers are 4 bytes long, what happens when the following code is executed.
main()
{
int x=0,*p=0;
x++; p++;
printf ("%d and %d\n",x,p);
}
a) 1 and 1 is printed
b) 1 and 4 is printed
c) 4 and 4 is printed
d) causes an exception
7. Which of the following is the correct code for strcpy, that is used to copy the contents from src to dest?
a) strcpy (char *dst,char *src)
{
while (*src)
*dst++ = *src++;
}
b) strcpy (char *dst,char *src)
{
while(*dst++ = *src++ )
}
c) strcpy (char *dst,char *src)
{
while(*src)
{ *dst = *src;
dst++; src++;
}
}
d) strcpy(char *dst, char *src)
{
while(*++dst = *++src);
}
ans:b
8. Consider the following program
main()
{
int i=20,*j=&i;
f1(j);
*j+=10;
f2(j);
printf("%d and %d",i,*j);
}
f1(k)
int *k;
{
*k +=15;
}
f2(x)
int *x;
{
int m=*x,*n=&m;
*n += 10;
}
The values printed by the program will be
a) 20 and 55
b) 20 and 45
c) 45 and 45
d) 45 and 55
e) 35 and 35
9. what is printed when the following program is compiled and executed?
int
func (int x)
{
if (x<=0)
return(1);
return func(x -1) +x;
}
main()
{
printf("%d\n",func(5));
}
a) 12
b) 16
c) 15
d) 11
