0% found this document useful (0 votes)
11 views5 pages

PPS Bit Bank

The document consists of a series of multiple-choice questions and fill-in-the-blank statements related to C programming concepts, including preprocessor directives, file operations, pointers, search algorithms, and sorting techniques. It covers topics such as the C library for file operations, macro definitions, and the complexities of various search algorithms. The questions are designed to test knowledge on C programming syntax, functions, and data structures.

Uploaded by

shahid9346394038
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views5 pages

PPS Bit Bank

The document consists of a series of multiple-choice questions and fill-in-the-blank statements related to C programming concepts, including preprocessor directives, file operations, pointers, search algorithms, and sorting techniques. It covers topics such as the C library for file operations, macro definitions, and the complexities of various search algorithms. The questions are designed to test knowledge on C programming syntax, functions, and data structures.

Uploaded by

shahid9346394038
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

1. The C-preprocessor are specified with___________ symbol.

[ ]
a) # b) $ c} “ “ d) None of the mentioned
2. What is the output of the following code ?
#include<stdio.h>
#define X 10
Int main()
{
X++;
printf(“%d”,X);
return 0;
} [ ]
a)10 b)11 c)Compilation error d)Not defined

3. Which of the below functionality is offered by the preprocessor. [ ]

a) The inclusion of header files

b) The inclusion of macro expansions

c) Conditional compilation and line control

d) All of the mentioned above

4. Which of the following is not a predefined macro ? [ ]

a) LINE b) DATE c) STDC d) ERROR

5. Which of the following is considered auxiliary storage. [ ]

a) disk b) tape c) ROM d) RAM

e) both disk and tape

6. The C library that contains the prototype statement for file operation is [ ]

a) file.h b)proto.h c)std file.h d)stdio.h

e)stdlib.h

7. Which of the following file modes open a file in the write state for updating?

a) ab b) a+b c) rb d) r+b e) wb [ ]

8. which of the following statements about sequential file updating is false ?

a)Add ,change and delete transactions are used to update the file. [ ]

b)Sequential files are often updated in an online environment.

c) Sequential files contain structures with a key to identify the data.

d)The file must be processed starting at the beginning

e)The file must be entirely re-created when it is updated

1
9. Which of the following statement about files is false ? [ ]

a)Because they are more flexible,binary files are more portable.

b)Binary files contain data stored in the internal format of the computer.

c)Binary files usually contain records in the form of structured data.

d)text files store only character data.

e) some text file data need to be converted to internal storge formats for processing.

10. which one of the following is an invalid macro in C ? [ ]

a)#pragma b)#error c)#ifndef d)else if

1. The ______________function read the next character from the standard input steam and
return its value.
2. User files are created using the ____________type.
3. If a file does not exist, the append mode returns an ____________.
4. The ____________specifies the type of data that being formatted in formatting
input/output.
5. The ______________ function may be used to position a file at the beginning.
6. The _______________function may be used to close the file.
7. A ______________ is one or more fields that uniquely identify the data in a file.
8. The ___________ results when a failures occurs during on open or during either a read or
write operations.
9. A file can be read only if it is in_____________.
10. A file opened in the ______________ mode is a binary file opened in the read state and
update mode.
11. Using__________ to position of a file beyond the current end of file places the file in an
error state.

2
1. To tell the complier to store data at an address, use the [ ]
a) Address operator (&) b) Array operator ([])
c)Pointer operator (^) d)Indirective operator
2. The function that return the absolute value of a long integer is [ ]
a) Abs b) dabs c)fabs d)labs e)tabs
3. Give the following definitions. [ ]
int x;
int *p=&x;
int **pp=&p;

which answer can access the value stored in x? [ ]

a)P b) Pp c)&p d)* PP e)**pp

4. Given the following declarations.


Int x;
Doble d;
Int *p;
Double *q
Which of the following expression are not allowed? [ ]
a) P=&x b)P=&d c)q=&x; d)P=x;
5. Which of the following statements will not add 1 to a variable? [ ]
a) a++ b) a+=1 c) a=a+1 d) p++ e) *p=*p+1
6. Which of the following statements will not sub 1 to a variable? [ ]
a) a-- b) a-=1 c) a=a-1 d) p-- e) *p=*p-1
7. The ______ operator is used with a pointer to dereference the address contained in the
pointer. [ ]
a) Address (&) b)Assignment (=) c)Indirection (*) d)Pointer (^) e)Selection (>)
8. The_______ string manipulation function add to the end of another string. [ ]
a) stradd b) strcat c) strcmp d) strcpy e) strtok
9. The _______function is used to format a string into variable in memory. [ ]
a) scanf b)sscanf c)strfrmt d)strscan e)strtok
10. The_______ function reads a string from the standard input device. [ ]
a) fgets b) f puts c) gets d) getstr e) puts

1. The _____________ contains the programmer’s original program code.


2. The _____________ is a program design tool that is a program design tool that is a visual
representation of the logic in a function within a program
3. The _________ function reads data from the keyboard.
4. The ___________ conversion specification is used to read or write a short integer.
5. To print data left justified , you would use a _____________ in the conversion specification.
6. ________________ is not a part of a function.
7. The function definition contains_____________
8. The_____________ logical operator is true only when both operands are true
9. ______________is not a comparative operator in c.
10. Two- way selection is implemented with the_________ statement.

3
1. What is the worst case time complexity of linear search algorithm? [ ]
a) o(1) b) o(log n) c)o(n) d)o(n^2)
2. Finding the location of a given item in a collection of items is called [ ]
a) Discovering b) Finding c) Searching d) Minig
3. Complexity of linear search algorithm is [ ]
a) o(n) b)o(log n) c)o(n^2) d)o(n log n)
4. Binary search algorithm cannot be applied to [ ]
a) Sorted linked list b)Sorted binary tree

c)Sorted linear array d)Pointer array

5. The processor through which data are arranged according to their value is known as
a) Arranging b)Listing c)Parsing d)Sorting e)Searching [ ]
6. The__________ search locates the target item by starting at the beginning and moving
towards the end of the list [ ]
a) Ascending b) Binary c)Bubble d)Selection e)sequential
7. The______ sort finds the smallest element from the unsorted sublist and swaps it with
the element at the beginning of the unsorted of the unsorted data. [ ]
a) Bubble b)Exchange c)Insertion d)Quick e)selection
8. Which of the following is not the required condition for binary search algorithm?
a) The list must be sorted [ ]
b) These should be the direct access to the middle element in any sub list
c) There must be mechanism to delete and or insert element list
d) Number values should only be present
9. The average case occurs in linear search algorithm [ ]
a) When item is somewhere in the middle of the array
b) When item is not the array at all
c) When item is the last element in the array
d) Item is the last element in the array
10. Which of the following statements about a sequential search is false?
a) Any array can be searched using the sequential search. [ ]
b) If the target is not found, every element in the list is tested.
c) The efficiency of the sequential search is o(n).
d) The list must be ordered
e) The sequential search is generally recommended only for small files

1. To compute the maximum_______________ comparisons are necessary and sufficient.


2. In linear search, a____________ is made over all elements one by one.
3. The worst case time complexity of linear search algorithm is_______________ .
4. Binary search process only on _______________.
5. The time complexity of binary search algorithm is best case is ________________.
6. Finding the location of a given item in a collection of items is called _____________.
7. The ________________ is much more efficient than the linear search.
8. The selection, insertion and bubble sort are all_____________ sorts.
9. Comparisons are necessary and sufficient for computing both the minimum and the
maximum in______________.

4
10. Because of its efficiency , the ______________ search is the best search for any array,
regardless of its size and order.

You might also like