C Multiple Choice Questions And Answers
Here you can find C Multiple Choice Questions and Answers.
Why C Multiple Choice Questions and Answers Required?
In this C Multiple Choice Questions and Answers section you can learn and practice C Multiple Choice Questions and Answers to improve your skills in order to face technical inerview conducted by Banks.
By Practicing these interview questions, you can easily crack any Bank Exams interview.
Where can I get C Multiple Choice Questions and Answers?
AllIndiaExams provides you lots C Multiple Choice Questions and Answers with proper explanation. Fully solved examples with detailed answer description. All students, freshers can download C Multiple
Choice Questions and Answers as PDF files and eBooks.
How to solve these C Multiple Choice Questions and Answers?
You no need to worry, we have given lots of C Multiple Choice Questions and Answers and also we have provided lots of FAQ's to quickly answer the questions in the Bank Exams interview.
C Multiple Choice Questions and Answers - Chapters
- Preprocessor Questions & Answers
- Conditional Expressions Questions & Answers
- Constants Questions and Answers
- Data Types Questions and Answers
- Declarations Questions and Answers
- File Access Questions and Answers
- Pointers Questions and Answers
- Standard Input and Output Questions & Answers
- Storage Management Questions & Answers
- Typedef Questions & Answers
- Variable Names Questions & Answers
- Structures, Unions, Bit-fields Questions & Answers
- C Functions Questions & Answers
- C Data Types Questions & Answers
- C Operators Questions & Answers
- Control Flow Statements Questions & Answers
Preprocessor Questions & Answers
1. Property which allows to produce different executable for different platforms in C is called?
Preprocessor Questions & Answers
2. #include is called
Preprocessor Questions & Answers
3. C preprocessors can have compiler specific features.
Preprocessor Questions & Answers
4. C preprocessor is conceptually the first step during compilation.
Preprocessor Questions & Answers
5. Preprocessor feature that supply line numbers and file names to compiler is called?
Conditional Expressions Questions & Answers
1. What is the output of this C code?
int main()
{
int x = 2, y = 0;
int z = (y++) ? y == 1 && x : 0;
printf("%d\n", z);
return 0;
}
Conditional Expressions Questions & Answers
2. What is the output of this C code?
int main()
{
int x = 1;
int y = x == 1 ? getchar(): 2;
printf("%d\n", y);
}
Conditional Expressions Questions & Answers
3. What is the output of this C code?
int main()
{
int x = 1;
short int i = 2;
float f = 3;
if (sizeof((x == 2) ? f : i) == sizeof(float))
printf("float\n");
else if (sizeof((x == 2) ? f : i) == sizeof(short int))
printf("short int\n");
}
Conditional Expressions Questions & Answers
4. What is the output of this C code?
int main()
{
int a = 2;
int b = 0;
int y = (b == 0) ? a :(a > b) ? (b = 1): a;
printf("%d\n", y);
}
Conditional Expressions Questions & Answers
5. What is the output of this C code?
int main()
{
int y = 1, x = 0;
int l = (y++, x++) ? y : x;
printf("%d\n", l);
}
Constants Questions and Answers
1. What is the output of this C code?
int main()
{
enum {ORANGE = 12, MANGO, BANANA = 11, APPLE};
printf("APPLE = %d\n", APPLE);
}
Constants Questions and Answers
2. What is the output of this C code?
int main()
{
printf("C programming %s", "Class by\n%s AllIndiaExams", "SUPER");
}
Constants Questions and Answers
3. For the following code snippet:
char *str = “AllIndiaExams.in\0? “training classes”;
The character pointer str holds reference to string:
Constants Questions and Answers
4. What is the output of this C code?
#define a 20
int main()
{
const int a = 50;
printf("a = %d\n", a);
}
Constants Questions and Answers
5. What is the output of this C code?
int main()
{
int var = 010;
printf("%d", var);
}
Data Types Questions and Answers
1. Comment on the output of this C code?
int main()
{
int a[5] = {1, 2, 3, 4, 5};
int i;
for (i = 0; i < 5; i++)
if ((char)a[i] == '5')
printf("%d\n", a[i]);
else
printf("FAIL\n");
}
Data Types Questions and Answers
2. The format identifier ‘%i’ is also used for _____ data type?
Data Types Questions and Answers
3. Which data type is most suitable for storing a number 65000 in a 32-bit system?
Data Types Questions and Answers
4. Which of the following is a User-defined data type?
Data Types Questions and Answers
5. What is the size of an int data type?
Declarations Questions and Answers
1. What is the output of this C code?
void foo(const int *);
int main()
{
const int i = 10;
printf("%d ", i);
foo(&i);
printf("%d", i);
}
void foo(const int *i)
{
*i = 20;
}
Declarations Questions and Answers
2. Comment on the output of this C code?
int main()
{
const int i = 10;
int *ptr = &i;
*ptr = 20;
printf("%d\n", i);
return 0;
}
Declarations Questions and Answers
3. What is the output of this C code?
int main()
{
j = 10;
printf("%d\n", j++);
return 0;
}
Declarations Questions and Answers
4. Does this compile without error?
int main()
{
for (int k = 0; k < 10; k++);
return 0;
}
Declarations Questions and Answers
5. Does this compile without error?
int main()
{
int k;
{
int k;
for (k = 0; k < 10; k++);
}
}
File Access Questions and Answers
1. The first and second arguments of fopen are?
File Access Questions and Answers
2. For binary files, a ___ must be appended to the mode string.
File Access Questions and Answers
3. If there is any error while opening a file, fopen will return?
File Access Questions and Answers
4. Which is true about getc.getc returns?
File Access Questions and Answers
5. When a C program is started, O.S environment is responsible for opening file and providing pointer for that file?
Pointers Questions and Answers
1. What is the output of this C code?
int main()
{
char *p = NULL;
char *q = 0;
if (p)
printf(" p ");
else
printf("nullp");
if (q)
printf("q\n");
else
printf(" nullq\n");
}
Pointers Questions and Answers
2. What is the output of this C code?
int main()
{
int i = 10;
void *p = &i;
printf("%d\n", (int)*p);
return 0;
}
Pointers Questions and Answers
3. What is the output of this C code?
int main()
{
int i = 10;
void *p = &i;
printf("%f\n", *(float*)p);
return 0;
}
Pointers Questions and Answers
4. What is the output of this C code?
int *f();
int main()
{
int *p = f();
printf("%d\n", *p);
}
int *f()
{
int *j = (int*)malloc(sizeof(int));
*j = 10;
return j;
}
Pointers Questions and Answers
5. What is the output of this C code?
int *f();
int main()
{
int *p = f();
printf("%d\n", *p);
}
int *f()
{
int j = 10;
return &j;
}
Standard Input and Output Questions & Answers
1. Which among the following is odd one out?
Standard Input and Output Questions & Answers
2. For a typical program, the input is taken using.
Standard Input and Output Questions & Answers
3. What does the following command line signify?
Standard Input and Output Questions & Answers
4. What is the default return-type of getchar()?
Standard Input and Output Questions & Answers
5. The value of EOF is_____.
Storage Management Questions & Answers
1. The function ____ obtains block of memory dynamically.
Storage Management Questions & Answers
2. void * malloc(size_t n) returns:
Storage Management Questions & Answers
3. calloc() returns a storage that is initialized to.
Storage Management Questions & Answers
4. In function free(p), p is a:
Storage Management Questions & Answers
5. What is the output of this C code?
void main()
{
char *p = calloc(100, 1);
p = "welcome";
printf("%s\n", p);
}
Typedef Questions & Answers
1. The correct syntax to use typedef for struct is.
Typedef Questions & Answers
2. For the following expression to work, which option should be selected.
string p = “HELLO”;
Typedef Questions & Answers
3. Which of the given option is the correct method for initialization?
typedef char *string;
Typedef Questions & Answers
4. Which of the following is FALSE about typedef?
Typedef Questions & Answers
5. typedef which of the following may create problem in the program?
Variable Names Questions & Answers
1. C99 standard guarantees uniqueness of ____ characters for internal names.
Variable Names Questions & Answers
2. C99 standard guarantess uniqueness of _____ characters for external names.
Variable Names Questions & Answers
3. Which of the following is not a valid variable name declaration?
Variable Names Questions & Answers
4. Which of the following is not a valid variable name declaration?
Variable Names Questions & Answers
5. Variable names beginning with underscore is not encouraged. Why?
Structures, Unions, Bit-fields Questions & Answers
1. Which of the following are themselves a collection of different data types?
Structures, Unions, Bit-fields Questions & Answers
2. User-defined data type can be derived by___________.
Structures, Unions, Bit-fields Questions & Answers
3. Which operator connects the structure name to its member name?
Structures, Unions, Bit-fields Questions & Answers
4. Which of the following cannot be a structure member?
Structures, Unions, Bit-fields Questions & Answers
5. Which of the following structure declaration will throw an error?
C Functions Questions & Answers
1. What is the output of this C code?
int main()
{
void foo(), f();
f();
}
void foo()
{
printf("2 ");
}
void f()
{
printf("1 ");
foo();
}
C Functions Questions & Answers
2. What is the output of this C code?
int main()
{
void foo();
void f()
{
foo();
}
f();
}
void foo()
{
printf("2 ");
}
C Functions Questions & Answers
3. What is the output of this C code?
void foo();
int main()
{
void foo();
foo();
return 0;
}
void foo()
{
printf("2 ");
}
C Functions Questions & Answers
4. What is the output of this C code?
void foo();
int main()
{
void foo(int);
foo(1);
return 0;
}
void foo(int i)
{
printf("2 ");
}
C Functions Questions & Answers
5. What is the output of this C code?
void foo();
int main()
{
void foo(int);
foo();
return 0;
}
void foo()
{
printf("2 ");
}
C Data Types Questions & Answers
1. Comment on the output of this C code?
int main()
{
int a[5] = {1, 2, 3, 4, 5};
int i;
for (i = 0; i < 5; i++)
if ((char)a[i] == '5')
printf("%d\n", a[i]);
else
printf("FAIL\n");
}
C Data Types Questions & Answers
2. The format identifier ‘%i’ is also used for _____ data type?
C Data Types Questions & Answers
3. Which data type is most suitable for storing a number 65000 in a 32-bit system?
C Data Types Questions & Answers
4. Which of the following is a User-defined data type?
C Data Types Questions & Answers
5. What is the size of an int data type?
C Operators Questions & Answers
1. What is the output of this C code?
int main()
{
int i = -5;
int k = i %4;
printf("%d\n", k);
}
C Operators Questions & Answers
2. What is the output of this C code?
int main()
{
int i = 5;
int l = i / -4;
int k = i % -4;
printf("%d %d\n", l, k);
return 0;
}
C Operators Questions & Answers
3. What is the output of this C code?
int main()
{
int i = 7;
i = i / 4;
printf("%d\n", i);
return 0;
}
C Operators Questions & Answers
4. What is the value of x in this C code?
void main()
{
int x = 4 *5 / 2 + 9;
}
C Operators Questions & Answers
5. What is the output of this C code?
void main()
{
int x = 4.3 % 2;
printf("Value of x is %d", x);
}
Control Flow Statements Questions & Answers
1. Which keyword can be used for coming out of recursion?
Control Flow Statements Questions & Answers
2. What is the output of this C code?
int main()
{
int a = 0, i = 0, b;
for (i = 0;i < 5; i++)
{
a++;
continue;
}
}
Control Flow Statements Questions & Answers
3. What is the output of this C code?
int main()
{
int a = 0, i = 0, b;
for (i = 0;i < 5; i++)
{
a++;
if (i == 3)
break;
}
}
Control Flow Statements Questions & Answers
4. The keyword ‘break’ cannot be simply used within:
Control Flow Statements Questions & Answers
5. Which keyword is used to come out of a loop only for that iteration?