Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Question Bank - C Programming

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. 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

3. 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

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

Common C Questions
C Programming Frequently Asked Interview Questions
C Programming Questions for Job Interview

5. 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

6. Due to variable 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. calloc() belongs to which library
  1.     stdlib.h
  2.     malloc.h
  3.     calloc.h
  4.     None of above
Answer: Option 1

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

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


This post first appeared on IngenuityDias, please read the originial post: here

Share the post

Question Bank - C Programming

×

Subscribe to Ingenuitydias

Get updates delivered right to your inbox!

Thank you for your subscription

×