Advanced C Programming mcq
1. An …………..is a collection of variables of the same type. And they are declared like this:
-
Arry, int height (10)
Structure, struct height
Enumerated, Enum height (2)
2. In C++ Overloading is otherwise called as
-
virtual polymorphism
transient polymorphism
pseudo polymorphism
3. Find the output of the program:
main()
{
printf("%d", (8,4));
} int f(int a, int b)
{
if (a= b)
return a;
else if (a>b)
return f(a-b, b);
else
return f(a, b-a);
}
4. What will be output if you will compile and execute the following c code?
int extern x;
void main()
printf(“%d”,x);
x=2;
getch();
}
int x=23;
5. Which of the following are tokens in C ?
-
Keywords
Variables
Constants
6. Find the output of the following programs:
main ()
(printf("%d", { (8, 4)), }
int f(int a, int b) (if (a = = b) return a; else if (a > b)
return
f(a, b-a);
return f(ab, b); else
7. What is the control character for “a single character”.
-
%c
%d
%i
8. What is the control character for “a decimal integer”.
-
%c
%d
%i
9. C programs are converted into machine language with the help of
-
An Editor
A compiler
An operating system
10. Which escape character can be used to begin a new line in C ?
-
\a
\b
\m
11. A C variable cannot start with
-
An alphabet
A number
A special symbol other than underscore
12. Which escape character can be used to begin a new line in C?
-
\a
13. Which of the following is allowed in a C Arithmetic instruction
-
[]
{}
14. Which of the following shows the correct hierarchy of arithmetic operations in C
-
/ + * –
* – / +
+ – / *
15. If P and Q are properly declared and initialized pointers and x, y and z. are integer variables, then which of the following statement is not valid?
-
x=x+*P
y=*P+*Q
P=Q+10
16. Array passed as argument to a function
-
Address of the array
value of the first eliment of the array
Address of the first eliment of the array
17. The worst case time complexity of AVL tree is better in comparison to binary search tree for
-
Search and Insert Operations
Search and Delete Operations
Insert and Delete Operations
18. What are the new features of C11 or ISO IEC 9899 2011 standard.?
-
Type generic Macros, Static Assertions
Multi Threading, Anonymous Unions, quick_exit
Bounds Checking Interfaces, Anonymous Strurctures
19. C language was invented in which laboratories.?
-
Uniliver Labs
IBM Labs
AT&T Bell Labs
20. When we mention the prototype of a function?
-
Defining
Declaring
Prototyping
21. How would you round off a value from 1.66 to 2.0?
-
ceil(1.66)
floor(1.66)
roundup(1.66)
22. BCPL Language is also called..?
-
C Language
B Language
D Language
23. Which of the following operation produce an 1, If the input bits are 1 and 1?
-
or
and
exclusive or
24. If the word size is 16 bit then ~0 x c5 will be
-
0 x 3a
0xff3a
0x5c
25. The following statement P r I n t f ( ‘’ % f’’, 9/5); Prints
26. The function abort() is declared in the header file
-
<math.h>
<iostream.h>
<stdio.h>
27. Which of the following statements should be used to obtain a remainder after dividing 3.14 by 2.1 ?
-
rem = 3.14%2.1;
rem=modf(3.14, 2.1);
rem = fmod(3.14, 2.1);
28. If PI and P2 are properly declared and initialized pointers and x,y,z are integer variables, then which of the following statement is not valid?
-
x = x+P1
y = P1 *P2
Z= Z-P2/*P1
29. Which of the following shows the correct hierarchy of arithmetic operations in C
-
/ + * -
* - / +
+ - / *
30. 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.
Post a Comment
0 Comments