C Programming Question Answer

Interview Question Answer
We have started series of C programming Q&A for job interview candidates.Engineering Professionals and students alike will be benefited.We recommend our user to go through previous post to enhance their knowledge and increase their work productivity and skill ratings at their Job.

We encourage our readers to provide feedback and ask question if required. We have tried our best to avoid any errors/ misprints,but if found by our readers please let us know.You can reach us at info@ingenuitydias.com



C Question Bank
Differences between Mutex And Semaphore
Difference Between Process and Thread
Storage Classes Interview Q&A

1.We can insert pre written code in a C program by using
  1. #read
  2. #get
  3. #include
  4. #put
Answer: Option 3

2. The first expression in a for loop is
  1. Step value of loop
  2. Value of the counter variable
  3. Any of above
  4. None of above
Answer: Option 2

3. Break statement is used for
  1. Quit a program
  2. Quit the current iteration
  3. Both of above
  4. None of above
Answer: Option 2

4. Continue statement used for
  1. To continue to the next line of code
  2. To stop the current iteration and begin the next iteration from the beginning
  3. To handle run time error
  4. None of above
Answer: Option 2

5. What will be output of
#include
void main()
{
char test =`S`;
printf("\n%c",test);
}


  1. S
  2. Error
  3. Garbage value
  4. None of above
Answer: Option 1

6. Due to variables scope in c
  1. Variables created in a function cannot be used another function
  2. Variables created in a function can be used in another function
  3. Variables created in a function can only be used in the main function
  4. None of above
Answer: Option 1

7. What will be the output of following program
#include
main()
{
int x,y = 10;
x = y * NULL;
printf(\"%d\",x);
}


  1. error
  2. 0
  3. 10
  4. Garbage value
Answer: Option 2

8. Difference between calloc() and malloc()
  1. calloc() takes a single argument while malloc() needs two arguments
  2. malloc() takes a single argument while calloc() needs two arguments
  3. malloc() initializes the allocated memory to ZERO
  4. calloc() initializes the allocated memory to NULL
Answer: Option 2

9. Exit() is same as return
  1. TRUE
  2. FALSE
Answer: Option 2

10. calloc() belongs to which library
  1. stdlib.h
  2. malloc.h
  3. calloc.h
  4. None of above
Answer: Option 1

11. If include files can be nested
  1. Yes
  2. No
Answer: Option 1

12. Which of the following below is/are valid C keywords
  1. integer
  2. int
  3. null
  4. none of above
Answer: Option 2


13. total number of keywords in C are
  1. 30
  2. 32
  3. 48
  4. 132
Answer: Option 2

14. What is use of \r in c
  1. used to insert a vertical tab
  2. used to insert a tab
  3. places cursor at the end of line
  4. places cursor at the start of line
Answer: Option 4

15. What is dangling pointer in c
  1. if pointer is pointing to a memory location from where variable has been deleted
  2. if pointer is assigned to more than one variable
  3. if pointer is not defined properly
  4. none of above
Answer: Option 1

16. rand() function returns
  1. float value
  2. integer value
  3. any type
  4. none of above
Answer: Option 2

17. The compiler in C ignores all text till the end of line using

  1. //
  2. /
  3. */
  4. none of above

Answer: Option 1

18. Which operator in c can't be overloaded
  1. %
  2. +
  3. ::
  4. -
Answer: Option 3

19. Which operator has the highest priority
  1. ()
  2. []
  3. *
  4. /
Answer: Option 1

20. What is the purpose of getc()
  1. read a character from STDIN
  2. read a character from a file
  3. read all file
  4. read file random
Answer: Option 2

21. Can getch() be used to echo the input
  1. Yes
  2. No
Answer: Option 2

22. If (*p) and **p is same
  1. No
  2. Yes
Answer: Option 1

23. Difference between structures and unions is
  1. We can define functions within structures but not within a union
  2. We can define functions within union but not within a structure
  3. The way memory is allocated
  4. There is no difference
Answer: Option 3

24. What among following is true about stack
  1. stack cannot reuse its memory
  2. all elements are of different datatypes
  3. all operation done at one end
  4. none of above
Answer: Option 3

25. To access the members of structure which symbol is used
  1. *
  2. -
  3. ,
  4. .
Answer: Option 4

26. A member is a
  1. Variable in a structure
  2. Datatype of structure
  3. Structure pointer
  4. None of above
Answer: Option 1

27. Structures can be used
  1. to hold different datatypes
  2. have pointers to structures
  3. to assign to one another
  4. all of above
Answer: Option 4

28. UML meaning is
  1. Unique modeling language
  2. Unified modeling language
  3. Unified modern language
  4. Unified master language
Answer: Option 2

29. printf() belongs to which library of c
  1. stdlib.h
  2. stdio.h
  3. stdout.h
  4. stdoutput.h
Answer: Option 2

30. A variable in c
  1. must have a valid datatype
  2. can't have a name same as keyword
  3. must have a name starting with a character
  4. All of above
Answer: Option 4

Related

Variables 202275191206364417

Post a Comment

  1. It was very useful for me. Keep sharing such ideas in the future as well. This was actually what I was looking for, and I am glad to came here! Thanks for sharing the such information with us.

    ReplyDelete

SPAMMING will not be Appreciated.

emo-but-icon

Hot in week

Recent

Comments

Our Channel

Contact Us

Name

Email *

Message *

Follow by Email

item