Hcl |   6761

Hcl

HCL  test pattern and model question paper

 

Verbal ability-25 questions

Aptitude -25 questions

Reasoning-25 questions

Computer programming-25 questions

 

Section-A Verbal Ability

 

1. Indolence' is related to 'Work' in the same way as 'Taciturn' is related to:

 A. cheat                                             

B. Speak

C. Act                                                

D. Observe

Ans-C

 

 

2.'Metal' is related to 'Conduction' in the same way as 'Plastic' is related to:

A. Ground oil chemistry                    

B. Inflammability

C. Industry                                         

D. Insulation

Ans-C

 

 

3. Jade' is related to 'Green' in the same way as 'Garnet' is related to

A. Red                                                           

B. Orange

C. Blue                                               

D. Yellow

Ans-A

 

4.Find out the alternative which will replace the question mark.

123 : 132 :: 235 : ?

 

A 23²                                      

B. 25³

C. 35²                                     

D. 25²

Ans-C

 

 

5. Vishnu put his timepiece on the table in such a way that at 6 P.M. hour hand points to North. In which direction the minute hand will point at 9.15 P.M. ?

A.North                                  

B. South

C. South-East                         

D. West

Ans-D

 

 

6. Question consist of two words which have a certain relationship to each other followed by four pairs of related words, Select the pair which has the same relationship.

SYMPHONY:COMPOSER

A. Leonardo: music                           

B. art: appreciation

C. Fresco: painter                               

D. colours: pallet

Ans-B

 

 

7. Find TWO words, one from each group, which have the SAME or almost the same meaning.

SPIN, BEGIN, DIN       NOISE, MUSIC, BANG

A. SPIN-BANG                                            

B. DIN-MUSIC

C. DIN-NOISE                                             

D.BEGIN-BANG

E. SPIN-NOISE

Ans-B

 

8. The words RAGE, HERS, and GASH are coded 5136, 4265 and 3241, but not necessarily in that order. What is the code for GRASS?

A. 23455                                                        

B. 25413

C. 63422                                                        

D. 43266

Ans-D

 

 

9. Which is  the missing number?

5  ,  8  ,  5  ,  11  ,  5  ,  ( ? ) 

A.13                                                               

B.17

C. 9                                                                

D. 14

Ans-D

 

 

10. Look at this series 16 26 56 36 46 68 56 Now choose which pair of numbers comes next.

A. 80 66                                                         

B. 78 68

C.  66 82                                                        

D. 66 80

Ans-D

 

11. Choose the correct meaning of proverb/idiom given., If there is no correct meaning given, E (i.e.) 'None of these' will be the answer.

            “To be above board”

A. To have a good height                                          

B. They have no debts

C. To be honest in any business deal                         

D. To overcome someone      

E. None of these

 Ans-B

 

 

12. four alternatives are given for the idiom/phrase italicised and underlined in the sentence. Choose the alternative which best expresses the meaning of idiom/phrase.

“This matter has been hanging fire for the last many months and must therefore be decided one way or the other.”

A. stuck up                                                                 

B. a game without any result

C. going on slowly                                                     

D. ignored

Ans-B

 

13 Choose the correct word which can be substituted for the given word/sentence..\

“Murder of a brother”

A. Fastidious                                                              

B. Curator

C. Patricide                                                                

D. Fratricide

Ans-D

 

14. Pick out the most effective word(s) from the given words to fill in the blank to make the sentence meaningfully complete.

To err is ...... to forgive divine.

A. Mature                                                       

B. Human

C. Natural                                                      

D. beastly

Ans-C

 

15. In the question given below the sentences have been given in Active/Passive voice. From the given alternatives, choose the one which best expresses the given sentence in Passive/Active voice.

“A child could not have done this mischief.”

A. This mischief could not be done by a child.

B. This mischief could not been done by a child.

C. This mischief could not have been done by a child.

D. This mischief a child could not have been done.

Ans-C

 

16. Rearrange the following five sentences in proper sequence so as to for meaningful paragraph, then answer the questions given below them.

1.         Indeed, the mutations that the family has undergone in this century have been more          challenging than at any time of its evolution.

2.         Thus, we have nuclear families, single parent families, surrogate families and global           families to name just a few.

3.         How these changes have reduced our world view is an interesting field of study in            themselves.

4.         What we often forget is that the family as it exists today has expanded its orthodox          definition to include several variations.

5.         Each of these has brought it own attitudes and priorities.

Q.I  Which sentence should come fourth in the paragraph ?

A.3                                                                             

B.5

C.2                                                                             

D.1

Ans-B

 

17. Zachary has invited his three buddies over to watch the basketball game on his wide-screen television. They are all hungry, but no one wants to leave to get food. Just as they are arguing about who should make the food run, a commercial comes on for a local pizze-ria that delivers. The phone number flashes on the screen briefly and they all try to remember it. By the time Zachary grabs a pen and paper, each of them recollects a different number.

#1: All of the men agree that the first three numbers are 995.

#2: Three of them agree that the fourth number is 9.

#3: Three agree that the fifth number is 2.

#4: Three agree that the sixth number is 6; three others agree that the seventh number is also 6.

Which of the numbers is most likely the telephone number of the pizzeria?

A. 995-9266                                                               

B. 995-9336

C. 995-8266                                                               

D. 995-9268

Ans-A

 

Questions-(18-20) Answer according to the information given below

18. Six friends are sitting in a circle and are facing the centre of the circle. Deepa is between Prakash and Pankaj. Priti is between Mukesh and Lalit. Prakash and Mukesh are opposite to each other.

18. Who is sitting opposite to Prakash ?

A.        PritI                                                                

B. Lalit

C. Pankaj                                                                    

D.Mukesh

Ans-D

 

19. Who is sitting opposite to Priti ?

A. Mukesh                                                                 

B. Deepa

C. Prakash                                                                  

D. Pankaj

Ans-C

 

20. Who are the neighbors of Mukesh?

A. Deepa and Lalit                                        

B. Priti and Pankaj                                         

C. Pankaj and Deepa

D. Lalit and Prakash

Ans-B

 

21. Read the paragraph carefully and determine the main point the author is trying to make. What conclusion can be drawn from the argument? Each paragraph is followed by five statements.One statement supports the author's argument better than the others do.

In the past, consumers would rarely walk into an ice cream store and order low-fat ice cream. But that isn't the case today. An increasing health consciousness combined with a much bigger selection of tasty low-fat foods in all categories has made low-fat ice cream a very profitable item for ice cream store owners.

This paragraph best supports the statement that

A.        ice cream store owners no longer think that low-fat ice cream is an unpopular item.

B.        consumers are fickle and it is impossible to please them

C.        low-fat ice cream is more popular than other kinds of ice cream.

D.        ice cream store owners would be better off carrying only low-fat ice cream.

E.         low-fat ice cream produces more revenue than other low-fat foods.

Ans-A

 

22. Choose the one which best expresses the given sentence in Indirect/Direct speech.

"If you don't keep quite I shall shoot you", he said to her in a calm voice.

A.        He warned her to shoot if she didn't keep quite calmly.

B.        He said calmly that I shall shoot you if you don't be quite.

C.        He warned her calmly that he would shoot her if she didn't keep quite.

D.        Calmly he warned her that be quite or else he will have to shoot her.

Ans-C

 

23. Select the pair which has the same relationship.

THRUST:SPEAR

A.        mangle:iron    

B.        scabbard:sword

C.        bow:arrow      

D.        fence:epee

Ans-D

 

24. Pick out the best one which can complete incomplete stem correctly and meaningfully.

Even if it rains I shall come means ......

A.        if I come it will not rain

B.        if it rains I shall not come

C.        I will certainly come whether it rains or not

D.        whenever there is rain I shall come

E.         I am less likely to come if it rains

Ans-C

 

25. Pick out the best one which can complete incomplete stem correctly and meaningfully.

I felt somewhat more relaxed ......

A.        but tense as compared to earlier

B.        and tense as compared to earlier

C.        as there was already no tension at all

D.        and tension-free as compared to earlier

E.         because the worry had already captured by mind

Ans-D

 

Section-B Quantitative Aptitude

 

1. Jack and his wife went to a party where four other married couples were present. Every person shook hands with everyone he or she was not acquainted with. When the handshaking was over, Jack asked everyone, including his own wife, how many hands they shook. To his surprise, Jack got nine different answers. How many hands did Jack's wife shake?

A. 2                            

B.7

C. 8                            

D.4

Ans-D

 

2.  A cyclist drove one kilometer, with the wind in his back, in three minutes and drove the same way back, against the wind in four minutes. If we assume that the cyclist always puts constant force on the pedals, how much time would it take him to drive one kilometer without wind?

A. 3 4/7min                            

B.4min

C. 3 3/7min                            

D.4 3/8min

Ans-B

 

3. The value of log2 16 is:

A.1/8

B.4

C.8     

D.16

Ans-B

 

4. If the value of x lies between 0 & 1 which of the following is the largest?

A.  x                           

B.  -x

C.  x2                         

D. 1/x

Ans-D

 

5. It is being given that (232 + 1) is completely divisible by a whole number. Which of the following numbers is completely divisible by this number?

 

A. (216 + 1)               

B. (216 - 1)

C. (7 x 223)                

D. (296 + 1)

Ans-D

 

6.  The difference between simple and compound interests compounded annually on a certain sum of money for 2 years at 4% per annum is Re. 1. The sum (in Rs.) is:

A.  625                                   

B. 630

C.   640                                  

D.  650

Ans-A

 

7. There are two examinations rooms A and B. If 10 students are sent from A to B, then the number of students in each room is the same. If 20 candidates are sent from B to A, then the number of students in A is double the number of students in B. The number of students in room A is:

 

A. 20                          

B. 80

C. 100                        

D. 200

Ans-C

 

8. If the number 91876 * 2 is completely divisible by 8, then the smallest whole number in place of * will be:

A. 1                            

B. 2

C.  3                           

D. 4

E. None of these

Ans-C

 

9. Free notebooks were distributed equally among children of a class. The number of notebooks each child got was one-eighth of the number of children. Had the number of children been half, each child would have got 16 notebooks. Total how many notebooks were distributed ?

A. 512                        

B. 432

C. 256                        

D. 640

Ans-A

 

10. There are 7 letters A,B,C,D,E,F,G All are assigned some numbers from 1,2 to 7. B is in the middle if arranged as per the numbers A is greater than G same as F is less than C. G comes earlier than E.Which is the fourth letter ?

A. D                           

B. B

C.  G                          

D. A

Ans-C

 

11. 15 men take 21 days of 8 hrs. each to do a piece of work. How many days of 6 hrs. each would it take for 21 women if 3 women do as much work as 2 men?

A. 30                          

B.  19

C.  20                           

D.  29

Ans-A

 

12. If Rs. 10 be allowed as true discount on a bill of Rs. 110 due at the end of a certain time, then the discount allowed on the same sum due at the end of double the time is:

A. Rs. 20                    

B. Rs. 21.81

C. Rs. 22                    

D. Rs. 18.33

Ans-D

 

13. A man started a business investing Rs. 70,000. Ram joined him after six months with an amount of Rs.. 1,05,000 and Sam joined them with Rs. 1.4 lakhs after another six months. The amount of profit earned should be distributed in what ratio among Aman, Rakhi and Sagar respectively, 3 years after Aman started the business?

A. 7 : 6 : 10                

B . 12 : 15 : 16

C. 42 : 45 : 56            

D. Cannot be determined

Ans-B

 

14. Two goods train each 500 m long, are running in opposite directions on parallel tracks. Their speeds are 45 km/hr and 30 km/hr respectively. Find the time taken by the slower train to pass the driver of the faster one.

A. 12 sec                    

B. 24 sec

C. 48 sec                    

D. 60 sec

Ans-B

 

15.Raja started a software business by investing Rs. 50,000. After six months, Nanda joined her with a capital of Rs. 80,000. After 3 years, they earned a profit of Rs. 24,500. What was Raja's share in the profit?

A. Rs. 9,423               

B. Rs. 10,250

C.  Rs. 12,500            

D. Rs. 10,500

Ans-D

 

16. Six bells commence tolling together and toll at intervals of 2, 4, 6, 8 10 and 12 seconds respectively. In 30 minutes, how many times do they toll together ?

A.4                                                     

B.15

C.10                                                   

D.16

Ans-D

 

17. There are 620 people are attending to the Tennis and Cricket. In that 420 attending to the Tennis another 360 attending to the Cricket. How many of them attending to both the games.

 

18. The sum of two numbers is 16 and the sum of their squares is 113. Find the numbers.

A. 5 and 6                                          

B.8 and 9

C. 3 and 4                                          

D.7 and 8

Ans-D

 

19. A man ate 100 bananas in five days, each day eating 6 more than the previous day. How many bananas did he eat on the first day?

A.7                                                     

B.6

C. 9                                                    

D.8

Ans-D

 

20. A train moves with a speed of 108 kmph.Its speed in metres per second is

 A.  10.8         

B.  18

C.  30

D.  38.8

Ans-C

 

21.  A rectangular parking space is marked out by painting three of its sides.If the length of the unpainted side is 9 feet, and the sum of the lengths of the painted sides is 37 feet, then what is the area of the parking space in square feet?

A.  46

B.  81

C.  126           

D.  252 litres

Ans-C

 

22. The value of (0.2×0.2+0.01) (0.1×0.1+0.02)-1 is equal to

A.  5/3            

B.   9/5

C.  41/4          

D.  41/12

Ans-A

 

23. A cube of edge 5 cm is cut into cubes of each edge 1 cm. The ratio of the total surface area of one of the small cubes to that of the large cube is equal to

A.  1 : 5          

B.  1 : 25

C.  1 : 125      

D.  1 : 625

Ans-C

 

24. Seats for Mathematics, Physics and Biology in a school are in the ratio 5 : 7 : 8. There is a proposal to increase these seats by 40%, 50% and 75% respectively. What will be the ratio of increased seats?

A.        2 : 3 : 4           

B.        6 : 7 : 8

C.        6 : 8 : 9           

D.        None of these

Ans-A

 

25. In a mixture 60 litres, the ratio of milk and water 2 : 1. If the this ratio is to be 1 : 2, then the quanity of water to be further added is:

A.        20 litres          

B.        30 litres

C.        40 litres          

D.        60 litres

Ans-D

 

Section-C Reasoning

 

1. Look at this series: 22, 21, 23, 22, 24, 23, ... What number should come next?

A.        22       

B.        24

C.        25       

D.        26

Ans-C

 

2. Fill the blank in the middle of the series or end of the series.

QAR, RAS, SAT, TAU, _____

A.        UAV  

B.        UAT

C.        TAS    

D.        TAT

Ans-A

 

3. Which word does NOT belong with the others?

A.        tulip    

B.        rose

C.        bud     

D.        daisy

Ans-C

 

4. Yard is to inch as quart is to

A.        gallon 

B.        ounce

C.        milk    

D.        liquid

Ans-B

 

5. Here are some words translated from an artificial language.

moolokarn means blue sky

wilkospadi means bicycle race

moolowilko means blue bicycle

Which word could mean "racecar"?

A.        wilkozwet      

B.        spadiwilko

C.        moolobreil      

D.        spadivolo

Ans-D

 

6. Here are some words translated from an artificial language.

gorblflur means fan belt

pixngorbl means ceiling fan

arthtusl means tile roof

Which word could mean "ceiling tile"?

A.        gorbltusl         

B.        flurgorbl

C.        arthflur           

D.        pixnarth

Ans-D

 

7. Read the definition and all four choices carefully, and find the answer that provides the best example of the given definition.

An Informal Gathering occurs when a group of people get together in a casual, relaxed manner. Which situation below is the best example of an Informal Gathering?

A.        The book club meets on the first Thursday evening of every month.

B.        After finding out about his promotion, Jeremy and a few coworkers decide to go out        for a quick drink after work.

C.        Mary sends out 25 invitations for the bridal shower she is giving for her sister.

D.        Whenever she eats at the Mexican restaurant, Clara seems to run into Peter.

Ans-B

 

8. Choose an answer based on given information

The school principal has received complaints from parents about bullying in the school yard during recess. He wants to investigate and end this situation as soon as possible, so he has asked the recess aides to watch closely. Which situation should the recess aides report to the principal?

A.        A girl is sitting glumly on a bench reading a book and not interacting with her peers.

B.        Four girls are surrounding another girl and seem to have possession of her backpack.

C.        Two boys are playing a one-on-one game of basketball and are arguing over the last           basket scored.

D.        Three boys are huddled over a handheld video game, which isn't supposed to be on           school grounds.

Ans-B

 

9. Find the statement that must be true according to the given information.

Tim's commute never bothered him because there were always seats available on the train and he was able to spend his 40 minutes comfortably reading the newspaper or catching up on paperwork. Ever since the train schedule changed, the train has been extremely crowded, and by the time the doors open at his station, there isn't a seat to be found.

A.        Tim would be better off taking the bus to work.

B.        Tim's commute is less comfortable since the train schedule changed.

C.        Many commuters will complain about the new train schedule.

D.        Tim will likely look for a new job closer to home.

Ans-B

 

10. Find the statement that must be true according to the given information.

When they heard news of the hurricane, Maya and Julian decided to change their vacation plans. Instead of traveling to the island beach resort, they booked a room at a fancy new spa in the mountains. Their plans were a bit more expensive, but they'd heard wonderful things about the spa and they were relieved to find availability on such short notice.

A.        Maya and Julian take beach vacations every year.

B.        The spa is overpriced.

C.        It is usually necessary to book at least six months in advance at the spa.

D.        Maya and Julian decided to change their vacation plans because of the hurricane.

Ans-D

 

11. All the trees in the park are flowering trees.

Some of the trees in the park are dogwoods.

All dogwoods in the park are flowering trees.

If the first two statements are true, the third statement is

A.        true

B.        false

C.        uncertain

Ans-A

 

12. Read the below passage carefully and answer the questions:

If the legislature decides to fund the agricultural subsidy program, national radio, and the small business loan program, what two other programs could they fund?

A.        harbor improvements and international airport

B.        harbor improvements and school music program

C.        hurricane preparedness and school music program

D.        hurricane preparedness and international airport

E.         harbor improvements and hurricane preparedness

Ans-B

 

13. There are 8 houses in a line and in each house only one boy lives with the conditions as given below:

   1. Jack is not the neighbour Siman.

   2. Harry is just next to the left of Larry.

   3. There is at least one to the left of Larry.

   4. Paul lives in one of the two houses in the middle.

   5. Mike lives in between Paul and Larry.

If at least one lives to the right of Robert and Harry is not between Taud and Larry, then which one of the following statement is not correct ?

A.        Robert is not at the left end.

B.        Robert is in between Simon and Taud.

C.        Taud is in between Paul and Jack.

D.        There are three persons to the right of Paul.

Ans-C

 

14. A, B, C, D and E are sitting on a bench. A is sitting next to B, C is sitting next to D, D is not sitting with E who is on the left end of the bench. C is on the second position from the right. A is to the right of B and E. A and C are sitting together. In which position A is sitting ?

A.        Between B and D      

B.        Between B and C

C.        Between E and D      

D.        Between C and E

Ans-B

 

15. Which one will replace the question mark ?

Ans-6

 

16. Here 4 positions of a cube are shown. Which sign will be opposite to '+' ?

A.        %        

B.        -

C.        x         

D.        $

Ans-C

 

17. From the four positions of a dice given below, find the color which is opposite to yellow ?

A.        Violet 

B.        Red

C.        Rose   

D.        Blue

Ans-A

 

18. An institute organised a fete and 1/5 of the girls and 1/8 of the boys participated in the same. What fraction of the total number of students took part in the fete ?

A.        2/13

B.        13/40

C.        Data inadequate

D.        None of these

Ans-C

 

19. Today is Varun's birthday. One year, from today he will be twice as old as he was 12 years ago. How old is Varun today ?

A.        20 years

B.        22 years

C.        25 years

D.        27 years

Ans-C

 

20. Mr. Johnson was to earn £ 300 and a free holiday for seven weeks' work. He worked for only 4 weeks and earned £ 30 and a free holiday. What was the value of the holiday?

A.        £ 300

B.        £ 330

C.        £ 360

D.        £ 420

Ans-B

 

21. A shepherd had 17 sheep. All but nine died. How many was he left with ?

A.        Nil      

B.        8

C.        9         

D.        17

Ans-C

 

22. In three coloured boxes - Red, Green and Blue, 108 balls are placed. There are twice as many balls in the green and red boxes combined as there are in the blue box and twice as many in the blue box as there are in the red box. How many balls are there in the green box ?

A.        18

B.        36

C.        45

D.        None of these

Ans-D

 

23. In a class, there are 18 boys who are over 160 cm tall. If these constitute three-fourths of the boys and the total number of boys is two-thirds of the total number of students in the class, what is the number of girls in the class ?

A.        6         

B.        12

C.        18       

D.        24

Ans-B

 

24. If 100 cats kill 100 mice in 100 days, then 4 cats would kill 4 mice in how many days ?

A.        1 day

B.        4 days

C.        40 days

D.        100 days

Ans-D

 

25.In a garden, there are 10 rows and 12 columns of mango trees. The distance between the two trees is 2 metres and a distance of one metre is left from all sides of the boundary of the garden. The length of the garden is

A.        20 m

B.        22 m

C.        24 m

D.        26 m

Ans-C

 

Section-D Computer Programming

 

1. Find the output for the following C program fn f(x)

{

if(x<=0)

return;

else f(x-1)+x;

}

 

2. Find the output for the following C program main()

{

   intx=2,y=6,z=6;

   x=y=z;

   printf(%d",x)

}

 

3. You want to find out the value of the last element of an array. You write the following code. What will happen when you compile and run it.?

public class MyAr{

public static void main(String argv[]){

int[] i = new int[5];

System.out.println(i[5]);

}

}

A. An error at compile time

B. An error at run time

C. The value 0 will be output

D. The string "null" will be output.

 

4. 21.   What will be the output of the program ?

#include<stdio.h>

int main()

{

    enum days {MON=-1, TUE, WED=6, THU, FRI, SAT};

    printf("%d, %d, %d, %d, %d, %d\n", MON, TUE, WED, THU, FRI, SAT);

    return 0;

}

A. -1, 0, 1, 2, 3, 4                               

B. -1, 2, 6, 3, 4, 5

C. -1, 0, 6, 2, 3, 4                               

D. -1, 0, 6, 7, 8, 9

Ans-D

 

5. What do the following declaration signify?

int *ptr[30];

A.        ptr is a pointer to an array of 30 integer pointers.

B.        ptr is a array of 30 pointers to integers.

C.        ptr is a array of 30 integer pointers.

D.        ptr is a array 30 pointers.

Ans-B

 

6. What is the hidden bug with the following  statement?

                        assert(val++ != 0);

 

7. Is the following code legal?

void main()

{

typedef struct a aType;

aType someVariable;

struct a

{

int x;

      aType *b;

              };

}

Ans-no

 

8. Find the output.

            main()

       {         

       char a[4]="HELL";

       printf("%s",a);

       }

Ans- HELL%@!~@!@???@~~!

 

9. What is the difference between a string copy (strcpy) and a memory copy (memcpy)?

 

10. What is a pointer value and address?

 

11. What are the advantages of inheritance?

 

12. What are the advantages of using array of pointers to string instead of an array of strings?

 

13. What is pointer to a pointer?

 

14. What are built in functions?

 

15. What are the pointer declarations used in C?

 

16. What will be the output of the program?

#include<stdio.h>

typedef void v;

typedef int i;

 

int main()

{

    v fun(i, i);

    fun(2, 3);

    return 0;

}

v fun(i a, i b)

{

    i s=2;

    float i;

    printf("%d,", sizeof(i));

    printf(" %d", a*b*s);

}

A.   2, 8          

B.   4, 8

C.   2, 4          

D.   4, 12

Ans-D

 

17. What will be the output of the program?

#include<stdio.h>

int main()

{

    const int x=5;

    const int *ptrx;

    ptrx = &x;

    *ptrx = 10;

    printf("%d\n", x);

    return 0;

}

A.   5  

B.   10

C.   Error        

D.   Garbage value

Ans-C

 

18. The maximum combined length of the command-line arguments including the spaces between adjacent arguments is

A.   128 characters

B.   256 characters

C.   67 characters

D.   It may vary from one operating system to another

Ans-D

 

19. What will be the output of the program (myprog.c) given below if it is executed from the command line?

cmd> myprog one two three

/* myprog.c */

#include<stdio.h>

#include<stdlib.h>

int main(int argc, char **argv)

{

    printf("%s\n", *++argv);

    return 0;

}

A.        myprog           

B.        one

C.        two     

D.        three

Ans-B

 

20. What will be the output of the program

#include<stdio.h>

void fun(int);

int main(int argc)

{

    printf("%d\n", argc);

    fun(argc);

    return 0;

}

void fun(int i)

{

    if(i!=4)

        main(++i);

}

A.        1 2 3   

B.        1 2 3 4

C.        2 3 4   

D.        1

Ans-B

 

21. Which of the following function is correct that finds the length of a string?

 

A.

int xstrlen(char *s)

{

    int length=0;

    while(*s!='\0')

    {    length++; s++; }

    return (length);

}

 

B.

int xstrlen(char s)

{

    int length=0;

    while(*s!='\0')

        length++; s++;

    return (length);

}

 

C.

int xstrlen(char *s)

{

    int length=0;

    while(*s!='\0')

        length++;

    return (length);

}

 

D.

int xstrlen(char *s)

{

    int length=0;

    while(*s!='\0')

        s++;

    return (length);

}

 

Ans-A

 

22. Which of the following function is more appropriate for reading in a multi-word string?

A.        printf();           

B.        scanf();

C.        gets(); 

D.        puts();

Ans-C

 

23. What is the notation for following functions?

1.  int f(int a, float b)

    {

        /* Some code */

    }

 

2.  int f(a, b)

    int a; float b;

    {

        /* Some code */

    }

A.        1. KR Notation

            2. ANSI Notation      

B.        1. Pre ANSI C Notation

            2. KR Notation

C.        1. ANSI Notation

            2. KR Notation          

D.        1. ANSI Notation

            2. Pre ANSI Notation

Ans-C

 

24. Which bitwise operator is suitable for turning on a particular bit in a number?

A.        && operator   

B.        & operator

C.        || operator       

D.        | operator

Ans-D

 

25. Assuming a integer 2-bytes, What will be the output of the program?

#include<stdio.h>

int main()

{

    printf("%x\n", -1<<3);

    return 0;

}

Ans-B

feedback