#include <somefile.h> are _______ files and #include “somefile.h” ________ files.
1.Library, Library
2.Library, user-created header
3.User-created header, library
4.They can include all types of file
#include statement must be written _____
1. Before main()
2.Before any scanf/printf
3.After main()
4.It can be written anywhere
An array of similar data types which themselves are a collection of dissimilar data type are ___________
1.Linked Lists
2.Trees
3.Array of Structure
4.All of the mentioned
Arguments that take input by user before running a program are called?
1.Main function arguments
2.Main arguments
3.Command-Line arguments
4. Parameterized arguments
#pragma exit is primarily used for?
1.Checking memory leaks after exiting the program
2.Informing Operating System that program has terminated
3.Running a function at exiting the program
4.No such preprocessor exist
If #include is used with file name in angular brackets.
1.The file is searched for in the standard compiler include paths
2.The search path is expanded to include the current source directory
3.The search path will expand
4.None of the mentioned
If the file name is enclosed in angle brackets, then ___
1.The preprocessor treats it as a user-defined file
2.The preprocessor treats it as a system-defined file
3.The preprocessor treats it as a user-defined file & system-defined file
4. None of the mentioned
Which of following logical operation can be applied to pointers? (Assuming initialization int *a = 2; int *b = 3;)
1. a | b
2.a ^ b
3.a & b
4. None of the mentioned
C preprocessor is conceptually the first step during compilation.
1.TRUE
2.FALSE
3.Depends on the compiler
4.Depends on the standard
C preprocessors can have compiler specific features.
1.TRUE
2.FALSE
3.Depends on the standard
4.Depends on the platform
Can function definition be present in header files?
1.Yes
2.No
3. Depends on the compiler
4.Depends on the standard
Comment on an array of the void data type.
1.It can store any data-type
2. It only stores element of similar data type to first element
3.It acquires the data type with the highest precision in it
4. You cannot have an array of void data type
Conditional inclusion can be used for ______
1.Preventing multiple declarations of a variable
2.Check for existence of a variable and doing something if it exists
3.Preventing multiple declarations of same function
4.All of the mentioned
For each #if, #ifdef, and #ifndef directive.
1.There are zero or more #elif directives
2.Zero or one #else directive
3.One matching #endif directive
4.All of the mentioned
How is search done in #include and #include “somelibrary.h” according to C standard?
1.When former is used, current directory is searched and when latter is used, standard directory is searched
2.When former is used, standard directory is searched and when latter is used, current directory is searched
3. When former is used, search is done in implementation defined manner and when latter is used, current directory is searched
4.For both, search for ‘somelibrary’ is done in implementation-defined places
How is search done in #include and #include”somelibrary.h” normally or conventionally?
1.When former is used, current directory is searched and when latter is used, standard directory is searched
2.When former is used, predefined directory is searched and when latter is used, current directory is searched and then predefined directories are searched
3.When former is used, search is done in implementation defined manner and latter is used to search current directory
4.For both, search for somelibrary is done in implementation-defined manner
If the file name is enclosed in double quotation marks, then _________
1.The preprocessor treats it as a user-defined file
2. The preprocessor treats it as a system-defined file
3. The preprocessor treats it as a user-defined file & system-defined file
4.None of the mentioned
In a conditional inclusion, if the condition that comes after the if is true, then what will happen during compilation?
1.Then the code up to the following #else or #elif or #endif is compiled
2. Then the code up to the following #endif is compiled even if #else or #elif is present
3.Then the code up to the following #eliif is compiled
4.None of the mentioned
A local variable declaration with no storage class specified is by default _________
1.auto
2. extern
3.static
4.register
Preprocessor feature that supply line numbers and filenames to compiler is called?
1.Selective inclusion
2. macro substitution
3.Concatenation
4.Line control
Property which allows to produce different executable for different platforms in C is called?
1.File inclusion
2.Selective inclusion
3.Conditional compilation
4. Recursive macros
The #else directive is used for _________
1.Conditionally include source text if the previous #if, #ifdef, #ifndef, or #elif test fails
2.Conditionally include source text if a macro name is not defined
3.Conditionally include source text if a macro name is defined
4. Ending conditional text
The C-preprocessors are specified with _________symbol.
1.#
2.$
3.” ”
4. &
The preprocessor provides the ability for ____
1. The inclusion of header files
2.The inclusion of macro expansions
3.Conditional compilation and line control
4.All of the mentioned
User-defined data type can be derived by________
1. struct
2. enum
3. typedef
4.all of the mentioned
What are the applications of a multidimensional array?
1.Matrix-Multiplication
2.Minimum Spanning Tree
3.Finding connectivity between nodes
4.All of the mentioned
What is #include <stdio.h>?
1.Preprocessor directive
2.Inclusion directive
3.File inclusion directive
4.None of the mentioned
What is #include directive?
1.Tells the preprocessor to grab the text of a file and place it directly into the current file
2.Statements are not typically placed at the top of a program
3.All of the mentioned
4.None of the mentioned
What is a preprocessor?
1.That processes its input data to produce output that is used as input to another program
2.That is nothing but a loader
3.That links various source files
4.All of the mentioned
What is the advantage of #define over const?
1.Data type is flexible
2.Can have a pointer
3.Reduction in the size of the program
4.None of the mentioned
What is the correct syntax to send a 3-dimensional array as a parameter? (Assuming declaration int a[5][4][3];)
1.func(a);
2.func(&a);
3.func(*a);
4.func(**a);
What is the maximum number of arguments that can be passed in a single function?
1.127
2.253
3. 361
4.No limits in number of arguments
What is the sequence for preprocessor to look for the file within <>?
1.The predefined location then the current directory
2.The current directory then the predefined location
3.The predefined location only
4. The current directory location
What is the size of *ptr in a 32-bit machine (Assuming initialization as int *ptr = 10;)?
1.1
2.2
3.4
4.8
What would happen if you create a file stdio.h and use #include “stdio.h”?
1.The predefined library file will be selected
2. The user-defined library file will be selected
3.Both the files will be included
4.The compiler won’t accept the program
Which directory the compiler first looks for the file when using #include?
1.Current directory where program is saved
2.C:COMPILERINCLUDE
3.S:SOURCEHEADERS
4.Both C:COMPILERINCLUDE and S:SOURCEHEADERS simultaneously
Which of the following are C preprocessors?
1.#ifdef
2. #define
3. #endif
4.all of the mentioned
Which of the following are themselves a collection of different data types?
1. string
2.structures
3.char
4.all of the mentioned
Which of the following arithmetic operation can be applied to pointers a and b? (Assuming initialization as int *a = (int *)2; int *b = (int *)3;)
1.a + b
2. a – b
3.a * b
4.a / b
Which of the following can never be sent by call-by-value?
1.Variable
2.Array
3.Structures
4.Both Array and Structures
Which of the following cannot be a structure member?
1. Another structure
2.Function
3.Array
4.None of the mentioned
Which of the following declaration will result in run-time error?
1.int **c = &c;
2. int **c = &*c;
3. int **c = **c;
4.none of the mentioned
Which of the following file extensions are accepted with #include?
1..h
2. .in
3..com
4.All of the mentioned
Which of the following is not possible statically in C?
1. Jagged Array
2. Rectangular Array
3.Cuboidal Array
4.Multidimensional Array
Which of the following is not possible under any scenario?
1. s1 = &s2;
2.s1 = s2;
3.(*s1).number = 10;
4.None of the mentioned
Which of the following names for files not accepted?
1.header.h.h
2.header.h.h
3. _head_er.h
4.None of the mentioned
Which of the following operation is illegal in structures?
1.Typecasting of structure
2.Pointer to a variable of the same structure
3.Dynamic allocation of memory for structure
4.All of the mentioned
Which of the following return-type cannot be used for a function in C?
1.char *
2. struct
3.void
4.none of the mentioned
Which operator connects the structure name to its member name?
1.–
2.<-
3. .
4.Both <- and .
Which type of variables can have the same name in a different function?
1.Global variables
2.Static variables
3.Function arguments
4.Both static variables and Function arguments