C Programming Interview Questions Basics Viva Tutorials
https://ingenuitydias.blogspot.com/2015/06/c-programming-interview-questions.html
1.) If every node u in G is adjacent to every other node v in G, A graph is said to be
a.) isolated
b.) complete
c.) finite
d.) strongly connected
ANSWER: b.) complete
2.) In a Heap tree
a.) Values in a node is greater than every value in left sub tree and smaller than right sub tree
b.) Values in a node is greater than every value in children of it
c.) Both of above conditions applies
d.) None of the mentioned
ANSWER: b.) Values in a node is greater than every value in children of it
Structures Unions Enumeration - Flow-control in C
C Storage Classes
Variable Function And Structure
C Viva Questions for Freshers Basics
Embedded C-Twenty Interview Questions
3.) In a binary tree, certain null entries are replaced by special pointers which point to nodes higher in the tree for efficiency. These special pointers are called
a.) Leaf
b.) branch
c.) path
d.) thread
ANSWER: d.) thread
4.) To use the function tolower(), which of the following header file should be used
a.) string.h
b.) conio.h
c.) ctype.h
d.) None of the mentioned
ANSWER: c.) ctype.h
5.) What is function overloading?
a.) calling a function from another function
b.) having more than one function of same name
c.) calling a function from itself
d.) None of the mentioned
ANSWER: b.) having more than one function of same name
6.) The size of a structure can be determined by
a. size of variable name
b. sizeof(struct tag)
a.) Only a
b.) Only b
c.) Both a and b
d.)none of the above
ANSWER: c.) Both a and b
7.) fputs function is used to
a.) write characters to a file
b.) takes 2 parameters
c.) returns a character
d.) requires a file pointer
e.) write characters to a file, takes 2 parameters, returns a character
ANSWER: e.) write characters to a file, takes 2 parameters, returns a character
8.) Which of the following statements should be used to obtain a remainder after dividing 3.14 by 2.1 ?
a.) rem = 3.14 % 2.1;
b.) rem = modf(3.14, 2.1);
c.) rem = fmod(3.14, 2.1);
d.) Remainder cannot be obtain in floating point division.
ANSWER: c.) rem = fmod(3.14, 2.1);
9.) What are the types of linkages?
a.) Internal and External
b.) External, Internal and None
c.) External and None
d.) Internal
ANSWER: b.) External, Internal and None
10.) Which of the following special symbol allowed in a variable name?
a.) * (asterisk)
b.) | (pipeline)
c.) - (hyphen)
d.) _ (underscore)
ANSWER: d.) _ (underscore)
11.) The compiler will give an error if we attempt to get the address of a varaible with _________ stroage class.
a.) register keyword
b.) extern keyword
c.) static keyword
d.) auto keyword
ANSWER: a.) register keyword
12.)Which of the following is not a stream that is opened by every c program?
a.) stdlog
b.) stdout
c.) stdin
d.) stderr
ANSWER: a.) stdlog
13.) Which of the following best describe volatile keyword?
a.) Volatile keyword indicates that the variable is stored in volatile memory
b.) Volatile keyword indicates that the value of the variable cannot be determined at compile time
c.) Volatile keyword instruct the compiler not to do any optimization on that variable
d.) Volatile keyword indicates that it cannot be used with const keyword
ANSWER: c.) Volatile keyword instruct the compiler not to do any optimization on that variable
14.) Which of the following global variable is set when the log function (defines in ) fails?
a.) exceptionno
b.) errno
c.) log_error
d.) error
ANSWER: b.) errno
15.) According to ANSI specifications which is the correct way of declaring main when it receives command-line arguments?
a.) int main(int argc, char *argv[])
b.) int main(argc, argv)
int argc;
char *argv;
c.) int main()
{
int argc;
char *argv;
}
d.) None of above
ANSWER: a.) int main(int argc, char *argv[])
a.) isolated
b.) complete
c.) finite
d.) strongly connected
ANSWER: b.) complete
2.) In a Heap tree
a.) Values in a node is greater than every value in left sub tree and smaller than right sub tree
b.) Values in a node is greater than every value in children of it
c.) Both of above conditions applies
d.) None of the mentioned
ANSWER: b.) Values in a node is greater than every value in children of it
Structures Unions Enumeration - Flow-control in C
C Storage Classes
Variable Function And Structure
C Viva Questions for Freshers Basics
Embedded C-Twenty Interview Questions
3.) In a binary tree, certain null entries are replaced by special pointers which point to nodes higher in the tree for efficiency. These special pointers are called
a.) Leaf
b.) branch
c.) path
d.) thread
ANSWER: d.) thread
4.) To use the function tolower(), which of the following header file should be used
a.) string.h
b.) conio.h
c.) ctype.h
d.) None of the mentioned
ANSWER: c.) ctype.h
5.) What is function overloading?
a.) calling a function from another function
b.) having more than one function of same name
c.) calling a function from itself
d.) None of the mentioned
ANSWER: b.) having more than one function of same name
6.) The size of a structure can be determined by
a. size of variable name
b. sizeof(struct tag)
a.) Only a
b.) Only b
c.) Both a and b
d.)none of the above
ANSWER: c.) Both a and b
7.) fputs function is used to
a.) write characters to a file
b.) takes 2 parameters
c.) returns a character
d.) requires a file pointer
e.) write characters to a file, takes 2 parameters, returns a character
ANSWER: e.) write characters to a file, takes 2 parameters, returns a character
8.) Which of the following statements should be used to obtain a remainder after dividing 3.14 by 2.1 ?
a.) rem = 3.14 % 2.1;
b.) rem = modf(3.14, 2.1);
c.) rem = fmod(3.14, 2.1);
d.) Remainder cannot be obtain in floating point division.
ANSWER: c.) rem = fmod(3.14, 2.1);
9.) What are the types of linkages?
a.) Internal and External
b.) External, Internal and None
c.) External and None
d.) Internal
ANSWER: b.) External, Internal and None
10.) Which of the following special symbol allowed in a variable name?
a.) * (asterisk)
b.) | (pipeline)
c.) - (hyphen)
d.) _ (underscore)
ANSWER: d.) _ (underscore)
11.) The compiler will give an error if we attempt to get the address of a varaible with _________ stroage class.
a.) register keyword
b.) extern keyword
c.) static keyword
d.) auto keyword
ANSWER: a.) register keyword
12.)Which of the following is not a stream that is opened by every c program?
a.) stdlog
b.) stdout
c.) stdin
d.) stderr
ANSWER: a.) stdlog
13.) Which of the following best describe volatile keyword?
a.) Volatile keyword indicates that the variable is stored in volatile memory
b.) Volatile keyword indicates that the value of the variable cannot be determined at compile time
c.) Volatile keyword instruct the compiler not to do any optimization on that variable
d.) Volatile keyword indicates that it cannot be used with const keyword
ANSWER: c.) Volatile keyword instruct the compiler not to do any optimization on that variable
14.) Which of the following global variable is set when the log function (defines in ) fails?
a.) exceptionno
b.) errno
c.) log_error
d.) error
ANSWER: b.) errno
15.) According to ANSI specifications which is the correct way of declaring main when it receives command-line arguments?
a.) int main(int argc, char *argv[])
b.) int main(argc, argv)
int argc;
char *argv;
c.) int main()
{
int argc;
char *argv;
}
d.) None of above
ANSWER: a.) int main(int argc, char *argv[])