Type Here to Get Search Results !

C Programming MCQ with Answers [ SET - 10 ] | Computer Programming Mcq with Answers

 

C Programming MCQ with Answers

1.  Command line arguments are used to accept argument from - 

    command prompt of operating system 
    through scanf() statement
     both (a) & (b) 
ANSWER= (A) command prompt of operating system 

 

2. Which of the following feature of ‘C’ language is meant to provide reliable access to special memory locations

     static_const
     Pragma
    Volatile
ANSWER= (C) Volatile

 

3. The function rewind() -

    reads a character from a file,
     writes a character to a file, 
    sets the position to the beginning of the file,
ANSWER= (C)  sets the position to the beginning

 

4. ______ return type cannot return any value to the caller

     int
    float
    void
ANSWER= (C) void

 

5. A pointer variable of type _______ cannot be dereferenced\

     int*
    char*
    float*
ANSWER= (D) void*

 

6. The function ftell () -

     reads a character from a file 
    reads an integer from a file 
    gives the current position in the file
ANSWER= (C) gives the current position in the file

 

7. Choose the correct alternative to complete the following sentences: 

 The library function strcmp(“abc","ABC"); returns






ANSWER= (A) 32

 

8. The variables declared in a structure definition are called its 

     group variables.
     merged variables 
    member variables
ANSWER= (C) member variables

 

9. What will be output if you will compile and execute the following c code?

void main(){

int i=0;

if(i==0){

i=((5,(i=3)),i=1);

printf(“%d”,i);

}

else

printf(“equal”);

}





ANSWER= (C) 1

 

10.  By default a variable is assigned with 

    garbage



ANSWER= (B) 1

 

11. A file is declared as a pointer of data type - 

     int
     float
    string
ANSWER= (c) string

 

12. What will be output if you will compile and execute the following c code?

#define call(x) #x

void main(){

printf(“%s”,call(c/c++));

}




ANSWER= (d) Compiler error

 

13. The maximum length of a variable in C is ___





ANSWER= (A) 8

 

14.  A file open in "w+" mode can be -

    read/write
     read only
    write only
ANSWER= (A) read/write

 

15. The maximum number of dimension an array can have in C is




ANSWER= (D) Compiler dependent

 

16. What is right way to Initialization array?

    int num[6] = { 2, 4, 12, 5, 45, 5 } ;
     int n{} = { 2, 4, 12, 5, 45, 5 } ;
    int n{6} = { 2, 4, 12 } ;
ANSWER= (A) int num[6] = { 2, 4, 12, 5, 45, 5 } ;

 

17. A declaration float a,b; occupies ___ of memory

     1 byte
    4 bytes
     8 bytes
ANSWER= (C) 8 bytes

 

18.Which of the following string functions reverse the string?

    strrev()
     strcmp()
    strlen()
ANSWER= (A) strrev()

 

19.  The two user-defined data types are:

    enumerated, constructor
    Enumerated, typed
    Typedet, deconstructor
ANSWER= (B) Enumerated, typed

 

20. An array elements are always stored in _________ memory locations.

    sequential
    random
    sequential and random
ANSWER= (A) sequential

 

21. What are the legal variable names that can be included in the C program.

     Printf, x1, gama, scanf
     Break (), struct, best-yet, result
    X1, out-file, gamma, x
ANSWER= (C) X1, out-file, gamma, x

 

22. The size of a String variable is

     1 byte
    8 bytes
    16 bytes
ANSWER= (D) None of these

 

23. Which of the following is an example of compounded assignment statement?

     a=5
    a+=5
     a=b=c
ANSWER= (B) a+=5

 

24.  A binary tree with 27 nodes has _______ null branches.





ANSWER= (D)  None Of These

 

25. Which one of the following is not a linear data structure?

    Array
    Binary Tree
    Queue
ANSWER= (B) Binary Tree

 

26. Recursive functions are executed in a?

     First In First Out Order
    Load Balancing
     Parallel Fashion
ANSWER= (D) Last In First Out Order

 

27. Which of the following is not a control statement in C language?

     goto statement
    switch statement
    for statement
ANSWER= (D) repeat until statement

 

28. Which of the following is charecter oriented console I/O function?

    getchar() and putchar()
    gets() and puts()
     scanf() and printf()
ANSWER= (A) getchar() and putchar()

 

29. Which of the following modifier is used to declare a variable as constant?

     const
    signed
    short
ANSWER= (A)  const

 

30. The Turbo C implementation of C Language supports

    High level file I/O
    System level file I/O
     Both a and b
ANSWER= (C) Both a and b



Friends if you like this post,kindly comment bellow and do share your responce.Thank You for Visiting.

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.

Top Post Ad

Below Post Ad