Signup/Sign In

C Language Interview Questions Test 11

This Test will cover complete C with very important questions, starting off from basics to advanced level.
Q. The value of automatic variable that is declared but not initialized will be?
Q. Choose the correct statement.
Q. Smallest element of Array Index is called __________?
Q. What are the types of linkages?

Q. Is there any difference between following declarations?
// 1st statement
extern int fun(); 
// 2nd statement
int fun();
Q. How would you round off a value from 1.66 to 2.0?
Q. What will be the output, if you will compile and execute the following C code?
void main() 
{
    char c = 125;
	c = c+10;
	printf("%d", c);
}
Q. What will be the output, if you will compile and execute the following C code?
#include<stdio.h>
void main()
{
    int a = 2;
	if(a == 2) 
	{
        a=~a+2<<1;
		printf("%d", a);
	}
	else 
	{
        break;
	}
}
Q. What will be output, if you will compile and execute the following C code?
#include <stdio.h>
#include <string.h>
void main() 
{
    char *str = NULL;
    strcpy(str, "cquestionbank");
	printf("%s", str);
}

Q. What would be the equivalent pointer expression for referring the array element a[i][j][k][l]?
Q. What is (void*)0?
Q. How can you combine the following two statements into one?
char *p;
p = (char*) malloc(100);
Q. In which header file is the NULL macro defined?
Q. How many bytes are occupied by near, far and huge pointers (DOS)?
Q. If a variable is a pointer to a structure, then which of the following operator is used to access data members of the structure through the pointer variable?

Related Tests: