1. Which symbol is used as a statement terminator in C?
2. What will be output if you will compile and execute the following c code?
struct marks{
int p:3;
int c:3;
int m:2;
};
void main(){
struct marks s={2,-6,5};
printf(“%d %d %d”,s.p,s.c,s.m);
}
-
2 -6 5
2 -6 1
2 2 1
3. Pointers are of
-
Integer data type
Character data type
Unsigned integer data types
4. Identify the invalid pointer arithmetic
-
Addition of float value to a pointer
Comparison of pointers that do not point to the element of the same array
Subtracting an integer from a pointer
5. …… is a library function used in C to display any output to the terminal. The text to be printed is enclosed in ……. quotes.
-
Printf, Single
Printf, double
Scanf, double
6. Following declaration in C++ -
int x ; int &p = x;
is same as the declaration
int x, *p; p =&x;
This remark is
-
true
false
sometimes true
7. Which is more appropriate for reading in a multiword string?
-
gets()
fgets()
scanf(
8. char name [] = {'T', 'W', 'D','T', 'A', '\0');
printf("%d", strlen (name));
The output is
9. What will be output if you will compile and execute the following c code?
void main(){
int a,b;
a=1,3,15;
b=(2,4,6);
clrscr();
printf(“%d “,a+b);
getch();
}
10. Which of the following symbol is used to denote a pre-processor statement?
11.Which of the following is a Scalar Data type
-
Float
Union
Array
12. What is the output?
char a[]="ABCD", b[ ]= "abcd":
strcpy(b,a);
printf("%s %s", a, b);
-
abcd ABCD,
ABCD ABCD.
ABCD abcd,
13. The _______ memory allocation function modifies the previous allocated space.
-
calloc
free
malloc
14. Number of binary trees formed with 5 nodes are
15. In C, if you pass an array as an argument to a function, what actually gets passed ?
-
Value of elements in array
First of elements of the array
Base address of the array
16. The Default Parameter Passing Mechanism is called as
-
Call by Value
Call by Reference
Call by Address
17. C is _______ type of programming language.?
-
Object Oriented
Procedural
Bit level language
18. What will happen if in a C program you assign a value to an array element whose subscript exceeds the size of array ?
-
The element will be set to 0
The compiler would report an error
The program may crash if some important data gets overwritten would appropriately grow
19. In which tree, for every node the height of its left subtree and right subtree differ almost by one?
-
Binary search tree
AVL tree
Threaded Binary Tree
20. What is the present C Language Standard.?
-
C99 ISO/IEC 9899:1999
C11 ISO/IEC 9899:2011
C05 ISO/IEC 9899:2005
21. If the two strings are identical, then strcmp() function returns
22. An _______ is a fixed size sequence collection of elements of the same data type
-
integer
function
array
23. Array passed as argument to a function is treated as:
-
Address of the array
Value of the first element of the array
Address of the first element of the array
24. The library function strcmp("abc","ABC"); returns
25. Which of the following function is used for sets the position to a desired point in the file
-
putc()
putw()
fseek()
26. If you want to exchange two rows in a two-dimensional array, the fastest way is to:
-
Exchange the elements of the 2rows
Exchange the address of each element in the two rows
Silence the address of the rows in an array of the pointer and exchange the pointer
27. An array is passed to a function as argument to the function in C language equivalent
- call by value
call by reference
call by name
28. …… allows the programs to interact with the screen, keyboard and file system of your computer.
-
# include (stdio.h>
#include <file.h>
#include <conio.h>
29.In C++ , following statement -
Class z : public X , public Y is an example of -
-
multiple inheritance
Multilevel Inheritance
linear Inheritance
30. Write the output of the following program fragment:
main()
{
printf("Hello World");
main();
}
-
compilation error
run time error
infinite loop
Post a Comment
0 Comments