1. What is an array?
-
An array is a collection of variables that are of the dissimilar data type.
An array is a collection of variables that are of the same data type.
An array is not a collection of variables that are of the same data type.
2. 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 } ;
3. #define max(a, b) a< b? a:b++;
int a; b;
a = 8, b = 9;
printf("%d", max(a.b));
The output is -
4. Which function is necessary to exist in each & every program?
-
void
sum
main
5. What is the answer of: 7%3
6. An array elements are always stored in _________ memory locations.
-
Sequential
Random
Sequential and Random
7. What is the right way to access value of structure variable book{ price, page }?
-
printf(“%d%d”, book.price, book.page);
printf(“%d%d”, price.book, page.book);
printf(“%d%d”, price::book, page::book);
8. perror( ) function used to ?
-
Work same as printf()
prints the error message specified by the compiler
prints the garbage value assigned by the compiler
9. Input/output function prototypes and macros are defined in which header file?
-
conio.h
stdlib.h
stdio.h
10. A function is a subroutine that may include one or more _______ designed to perform a specific task.
-
Functions
Statements
Libraries
11. What is used as a terminator in C?
a) ?
b) ;
c) :
d) _
Ans: b
12. Bitwise operators can operate upon?
-
double and chars
floats and doubles
ints and floats
13. What is C Tokens?
-
The smallest individual units of c program
The basic element recognized by the compiler
The largest individual units of program
14. What is Keywords?
-
Keywords have some predefine meanings and these meanings can be changed.
Keywords have some unknown meanings and these meanings cannot be changed.
Keywords have some predefine meanings and these meanings cannot be changed.
15. The keyword used to transfer control from a function back to the calling function is -
-
switch
goto
go back
16. How will you print \n on screen?
-
printf("\n")
echo\\n
printf("\n')
17. When we mention the prototype of a function?
-
Defining
Declaring
Prototyping
18. The statement printf(“%c”, 100); will print?
-
prints 100
print garbage
prints ASCII equivalent of 100
19. In C++, when accessing a structure member, the identifier to the left of the dot operator is the name of
-
structure tag
structure member
structure variable
20. How would you round off a value from 1.66 to 2.0 ?
-
ceil(1.66)
floor(1.66)
roundup(1.66)
21. To represent hierarchical relationship between elements, which data structure is suitable ?
-
Priority
Tree
Dqueue
22. Which of the following data structure is linear type?
-
Strings
Queue
Lists
23.How many values can be returned from a function?
24. A pointer is
-
data type of an address variable
a variable for storing address
indication of the variable to be accessed next
25.Is the following statement a declaration or definition?
extern int i;
-
declaration
definition
function
26. Is the following statement a declaration or definition?
extern int i
-
Declaration
Definition
Function
27. When fopen() fails to open a file it returns
-
NULL
-1
28. the EOF is equivalent to -
29. What is the action of strcmp() function
-
compare two strings
copies one string over another
finds the length of a string
30. Null character is represented by
Post a Comment
0 Comments