0% found this document useful (0 votes)
9 views

C Programming

The document contains a quiz on C programming concepts with multiple choice questions. It covers topics like data types, operators, functions, loops, arrays, structures, pointers and more. The questions test fundamental knowledge of C syntax, standard library functions and common data structures used in C like stacks, queues, linked lists and trees.

Uploaded by

Abiram R
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

C Programming

The document contains a quiz on C programming concepts with multiple choice questions. It covers topics like data types, operators, functions, loops, arrays, structures, pointers and more. The questions test fundamental knowledge of C syntax, standard library functions and common data structures used in C like stacks, queues, linked lists and trees.

Uploaded by

Abiram R
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

11/20/23, 1:55 PM C Programming

C Programming
[email protected] Switch account
Not shared

* Indicates required question

11. What is the sizeof(char) in a 32-bit C compiler? * 1 point

1 bit

2 bits

1 Bytes

2 Bytes

10. What is #include <stdio.h>? * 1 point

Preprocessor directive

Inclusion directive

File inclusion directive

None of the mentioned

https://docs.google.com/forms/d/e/1FAIpQLScZc9BcUAHgLmlb3Jcu5a7nMcdeUnn62EdCAs9EYPiMQpPSVg/viewform 1/16
11/20/23, 1:55 PM C Programming

27. Which of the following points is/are not true about Linked List data * 1 point
structure when it is compared with an array?

Random access is not allowed in a typical implementation of Linked Lists

Access of elements in linked list takes less time than compared to arrays

Arrays have better cache locality that can make them better in terms of performance

It is easy to insert and delete elements in Linked List

13. scanf() is a predefined function in______header file. * 1 point

stdlib. h

ctype. h

stdio. h

stdarg. h

6. What is the result of logical or relational expression in C? * 1 point

True or False

0 or 1

0 if an expression is false and any positive number if an expression is true

None of the mentioned

https://docs.google.com/forms/d/e/1FAIpQLScZc9BcUAHgLmlb3Jcu5a7nMcdeUnn62EdCAs9EYPiMQpPSVg/viewform 2/16
11/20/23, 1:55 PM C Programming

7. What is an example of iteration in C? * 1 point

for

while

do-while

all of the mentioned

20. In C, parameters are always * 1 point

Passed by value

Passed by value result

Passed by reference

Non-pointer variables are passed by value and pointers are passed by reference

33. Which of the following is the simplest data structure that supports range * 1 point
searching?

AA-trees

K-d trees

Heaps

binary search trees

https://docs.google.com/forms/d/e/1FAIpQLScZc9BcUAHgLmlb3Jcu5a7nMcdeUnn62EdCAs9EYPiMQpPSVg/viewform 3/16
11/20/23, 1:55 PM C Programming

31. The optimal data structure used to solve Tower of Hanoi is _________ * 1 point

Tree

Heap

Priority queue

Stack

22. What are the disadvantages of arrays? * 1 point

Index value of an array can be negative

Elements are sequentially accessed

Data structure like queue or stack cannot be implemented

d) There are chances of wastage of memory space if elements inserted in an array


are lesser than the allocated size

2.Which of the following is not a valid C variable name? * 1 point

int number;

float rate;

int variable_count;

int $main;

https://docs.google.com/forms/d/e/1FAIpQLScZc9BcUAHgLmlb3Jcu5a7nMcdeUnn62EdCAs9EYPiMQpPSVg/viewform 4/16
11/20/23, 1:55 PM C Programming

37. Which of the following is the correct way of declaring an array? * 1 point

int javatpoint[10];

int javatpoint;

javatpoint{20};

array javatpoint[10];

3. All keywords in C are in ____________ * 1 point

LowerCase letters

UpperCase letters

CamelCase letters

None of the mentioned

18. Which one of the following is a loop construct that will always be * 1 point

executed once?

for

while

switch

do while

https://docs.google.com/forms/d/e/1FAIpQLScZc9BcUAHgLmlb3Jcu5a7nMcdeUnn62EdCAs9EYPiMQpPSVg/viewform 5/16
11/20/23, 1:55 PM C Programming

16. What is required in each C program? * 1 point

The program must have at least one function.

The program does not require any function.

Input data

Output data

30. Which of the following data structure can provide efficient searching of * 1 point
the elements?

binary search tree

unordered lists

2-3 tree

treap

32. Which is the most appropriate data structure for reversing a word? * 1 point

stack

queue

graph

tree

https://docs.google.com/forms/d/e/1FAIpQLScZc9BcUAHgLmlb3Jcu5a7nMcdeUnn62EdCAs9EYPiMQpPSVg/viewform 6/16
11/20/23, 1:55 PM C Programming

9. Functions in C Language are always _________ * 1 point

Internal

External

Both Internal and External

External and Internal are not valid terms for functions

23. Which data structure is used for implementing recursion? * 1 point

Stack

Queue

List

Array

26. The data structure required for Breadth First Traversal on a graph is? * 1 point

Array

Stack

Tree

Queue

https://docs.google.com/forms/d/e/1FAIpQLScZc9BcUAHgLmlb3Jcu5a7nMcdeUnn62EdCAs9EYPiMQpPSVg/viewform 7/16
11/20/23, 1:55 PM C Programming

15. What will be the output of the following C code? * 1 point


#include <stdio.h>
int main()
{
signed char chr;
chr = 128;
printf("%d\n", chr);
return 0;
}

128

-128

Depends on the compiler

None of the mentioned

35. Which type of data structure is a ternary heap? * 1 point

Hash

Array

Priority Stack

Priority Queue

19. How many bytes does "int = D" use? * 1 point

2 or 4

10

https://docs.google.com/forms/d/e/1FAIpQLScZc9BcUAHgLmlb3Jcu5a7nMcdeUnn62EdCAs9EYPiMQpPSVg/viewform 8/16
11/20/23, 1:55 PM C Programming

12. Which of the following is not an operator in C? * 1 point

sizeof()

None of the mentioned

21. What is a data structure? * 1 point

A programming language

A collection of algorithms

A way to store and organize data

A type of computer hardware

4.Which of the following is true for variable names in C? * 1 point

Which of the following is true for variable names in C?

It is not an error to declare a variable to be one of the keywords(like goto, static)

Variable names cannot start with a digit

Variable can be of any length

https://docs.google.com/forms/d/e/1FAIpQLScZc9BcUAHgLmlb3Jcu5a7nMcdeUnn62EdCAs9EYPiMQpPSVg/viewform 9/16
11/20/23, 1:55 PM C Programming

1.Who is the father of C language? 1 point

Steve Jobs

James Gosling

Dennis Ritchie

Rasmus Lerdorf

28. Which of the following tree data structures is not a balanced binary * 1 point
tree?

Splay tree

B-tree

AVL tree

Red-black tree

29.Which of the following is the most widely used external memory data * 1 point
structure?

B-tree

Red-black tree

AVL tree

Both AVL tree and Red-black tree

https://docs.google.com/forms/d/e/1FAIpQLScZc9BcUAHgLmlb3Jcu5a7nMcdeUnn62EdCAs9EYPiMQpPSVg/viewform 10/16
11/20/23, 1:55 PM C Programming

40. Which of the following is not the correct statement for a stack data * 1 point
structure?

Arrays can be used to implement the stack

Stack follows FIFO

Elements are stored in a sequential manner

Top of the stack contains the last inserted element

25. What is the value of the postfix expression 6 3 2 4 + – *? * 1 point

74

18

22

40

34. What is the advantage of a hash table as a data structure? * 1 point

easy to implement

faster access of data

exhibit good locality of reference

very efficient for less number of entries

https://docs.google.com/forms/d/e/1FAIpQLScZc9BcUAHgLmlb3Jcu5a7nMcdeUnn62EdCAs9EYPiMQpPSVg/viewform 11/16
11/20/23, 1:55 PM C Programming

36. How can we describe an array in the best possible way? * 1 point

The Array shows a hierarchical structure.

Arrays are immutable.

Container that stores the elements of similar types

The Array is not a data structure

5.Which is valid C expression? * 1 point

int my_num = 100,000;

int my_num = 100000;

int $my_num = 10000;

int my num = 1000;

8. Functions can return enumeration constants in C? * 1 point

true

false

depends on the compiler

depends on the standard

https://docs.google.com/forms/d/e/1FAIpQLScZc9BcUAHgLmlb3Jcu5a7nMcdeUnn62EdCAs9EYPiMQpPSVg/viewform 12/16
11/20/23, 1:55 PM C Programming

24. Which data structure is needed to convert infix notation to postfix * 1 point
notation?

Tree

Branch

Stack

Queue

38. Which of the following is the advantage of the array data structure? * 1 point

Elements of mixed data types can be stored.

Easier to access the elements in an array

Index of the first element starts from 1.

Elements of an array cannot be sorted

https://docs.google.com/forms/d/e/1FAIpQLScZc9BcUAHgLmlb3Jcu5a7nMcdeUnn62EdCAs9EYPiMQpPSVg/viewform 13/16
11/20/23, 1:55 PM C Programming

14. What will be the output of the following C code? * 1 point


#include <stdio.h>
int main()
{
int y = 10000;
int y = 34;
printf("Hello World! %d\n", y);
return 0;
}

Compile time error

Hello World! 34

Hello World! 1000

Hello World! followed by a junk value

39. Which one of the following is the process of inserting an element in the * 1 point
stack?

Insert

Add

Push

None of the above

https://docs.google.com/forms/d/e/1FAIpQLScZc9BcUAHgLmlb3Jcu5a7nMcdeUnn62EdCAs9EYPiMQpPSVg/viewform 14/16
11/20/23, 1:55 PM C Programming

17. What is the output of this statement "printf("%d", (a++))"? * 1 point

The value of (a + 1)

The current value of a

Error message

Garbage

Next Page 1 of 2 Clear form

This form was created inside of SNS College of Technology. Report Abuse

Forms

https://docs.google.com/forms/d/e/1FAIpQLScZc9BcUAHgLmlb3Jcu5a7nMcdeUnn62EdCAs9EYPiMQpPSVg/viewform 15/16
11/20/23, 1:55 PM C Programming

https://docs.google.com/forms/d/e/1FAIpQLScZc9BcUAHgLmlb3Jcu5a7nMcdeUnn62EdCAs9EYPiMQpPSVg/viewform 16/16

You might also like