Technical/logical interview questions in C language –freshers must read it!!

1. What type of memory could be accessed in least time?
(a)cache memory
(b)secondary memory
(c)main memory
(d)none
Ans:A

2. void main()
 
   {
 
      int const * p=5;
 
      printf("%d",++(*p));
 
   }

What is the output?
(a) 6
(b) 5
(c) Compiler error
(d) Run time error
Ans :c

3.

 main()
 
      {
 
      static int var = 5;
 
      printf("%d ",var--);
 
      if(var)
 
            main();
 
      }

What is the output?
(a) 1 2 3 4 5
(b) infinite loop
(c) 5 4 3 2 1
(d) compiler error
Ans :c

4.

main()

{

printf("\nab");

printf("\bsi");

printf("\rha");

}

(a) has
(b) hasaiaab
(c) hai
(d) aas
Ans :c

5.

 #include 
#define a 10
main()
 
{
 
#define a 50
 
printf("%d",a);
 
}

(a) 10
(b) 50
(c) error
(d) none
Ans:B

6. Minimum number of queues needed to implement the priority queue?
(a) one
(b) two
(c) three
(d) zero
Ans:B

7. What are the notations used in Evaluation of Arithmetic Expressions using prefix and postfix forms?
(a) Reverse Polish notations
(b) Polish
(c) both
(d) none
Ans :C

8. In tree construction which is the suitable efficient data structure?
(a) Array
(b) Linked list
(c) Stack
(d) Queue
Ans :B

9. Of the following tree structure, which is, efficient considering space and time complexities?
(a) Incomplete Binary Tree
(b) Complete Binary Tree
(c) Full Binary Tree
(d) None
Ans:B

10. What operator performs pattern matching?
(a) LIKE
(b) NULL
(c) WHERE
(d) AS
Ans :A

11. What is the output of the following query?
SELECT TRUNC(1234.5678,-2) FROM DUAL
(a) 1235
(b) 1200
(c) 1234.5
(d) 1234
Ans:B

12. What is the use of the DROP option in the ALTER TABLE command?
(a) It is used to drop constraints specified on the row
(b) It is used to drop constraints specified on the table.
(c) It is used to drop constraints specified on the column
(d) all
Ans :B

13. Which is the parameter that is added to every non-static member function when it is called?
(a)‘this’ pointer
(b) ‘far’ pointer
(c)‘near’ pointer
(d) all
Ans:A

14. A collection of programs that enables user to create and maintain a database is called
(a) DBMS
(b) DB
(c) DBA
(d) All
Ans:A

15. Model based on collection of objects is
(a) E-R Model
(b) Data Model
(c) Object Oriented Model
(d) None
Ans:C

16. When one of the data elements stored within a construct is utilized as the primary key, then it is called

(a) Foreign key
(b) Natural key
(c) Primary key
(d) Alternate key
Ans:B

17. different phases of transaction?
(a) Analysis & Redo
(b) Redo & Undo
(c) Analysis & Redo & Undo
(d) None
Ans:C

18.

void main() 
    { 
     int i=7; 
     printf("%d",i++*i++); 
    }

What is the output?
(a) 56
(b) 65
(c) 5 6
(d) 6 5
Ans:A

19. Output of the following program is

main() 

{

int i=0; 

for(i=0;i<20;i++) 

{

switch(i) 

case 0:i+=5; 

case 1:i+=2; 

case 5:i+=5; 

default i+=4; 

break;} 

printf("%d,",i); 

} 

}

(a) 0,5,9,13,17
(b) 5,9,13,17
(c) 12,17,22
(d) 16,21
Ans:D

20. Find the output

main() 

{ 

int x=5; 

printf("%d %d %d\n",x,x<<2,x>>2); 

}

(a) 1 5 20
(b) 20 5 1
(c) 5 20 1
(d) 1 5 10
Ans:C

If you have questions, please ask below

82 Comments


  1. swapna says:

    i want more questions & send to my mail id plz………

  2. Prashanth says:

    good questions….

  3. Amudha says:

    need explinatioins for program related qest!

  4. satish says:

    pls send me some gud questions with explanation

  5. Pradeep says:

    send me more questions

  6. Divya says:

    thank u…..good questns,,,plz send more num of ques to my mail….

  7. Mahesh says:

    Mail id sollu… I’ll send you..

  8. pushpendra says:

    what is the defference between union and structure

  9. pushpendra says:

    i need solution of some technical question such as quee and stack

  10. gudiya says:

    i am not understanding the answer the for question no. 3,4,18,19 plz send me the solution for these questions & also sum more questions on my mail..

  11. Namita Dash says:

    pls send me more number of questions on my emailid.

  12. swati says:

    can u just give explainations along with the answers…

  13. satish says:

    plz end me more number of questions with an explanation to my mail

  14. sekhar says:

    please send more number of logical questions

  15. chani says:

    which book i use for self learning or self study of c,c++.
    and
    espicialy for .net
    for apti and interview.
    i want devlop my logic
    please please

  16. sujit says:

    I want The solutions for these all questions deeply..

  17. jyoti says:

    i want the solutions for these all questions..

  18. santu says:

    what is differnce between compiler and interpreter?

  19. arun chavan says:

    plz send basic c&c++ important quation with answer in my mail

  20. ravi says:

    i want the solutions for these all questions.with questions.

  21. m.anitha says:

    i want required some more question pls send to my email id

  22. sudha says:

    i need clear definition 4 each and every questions.

  23. satish says:

    what is value of r after evaluating expression:r=1/2+1/2;

  24. Kishore Das says:

    plz i want more C logical programming questions….plz..plz…plz…

  25. gyanesh gupta says:

    plz send explanation of question no 20

Leave a Reply

If you have any questions headover to our forums

You can use these XHTML tags: <a href="" title=""> <abbr title=""> <acronym title=""> <blockquote cite=""> <code> <em> <strong>