1. In C++, a function contained within a class is called
-
a method
a class function
member function
2. What is result of 16 >> 2? -
3. Every string must be terminated by
-
Linefeed character
Null character
Newline character
4. What will be the value of c after execution of this program?
void main()
{int a 9, b = 10, c;
c= (b <a || b > a);
printf("c-%d", c);
}
-
c = 1
c = 0
c = 1
5. Recursive functions are executed in a?
-
first in first out order
load balancing
parallel fashion
6. What will be the output of the following arithmetic expression ?
5+3*2%10-8*6
-
-37
-42
-32
7. getch(); works like
-
printf
scanf
variable
8. Which one of the following is not a linear data structure?
-
array
binary tree
queue
9. What will be the output of the following statement ?
int a=10; printf(“%d &i”,a,10);
-
error
10
10 10
10. What will be the output of the following statement ?
printf(“%X%x%ci%x”,11,10,’s’,12);
-
error
basc
Bas94c
11. The _________ is a computer program that translates the source code into corresponding object code
-
Compiler
Assembler
COBOL
12. Which is the reserved keyword in C? -
-
null,
union,
printf,
13. A. Halt execution of program
-
b. restart execution
f program
exit from loop or switch statement
14. Which one is a special function in C system to tell the computer where the program start
-
go()
sub()
main()
15. If a 15 and b = 4, what is the value of a%b?
-
-3,
3, 4
16. Which of the following function is used for sets the position to the beginning of the file
-
putw()
getw()
setw()
17. What will be the output of the following statements ?
int a = 4, b = 7,c; c = a = = b; printf(“%i”,c);
error
18. What will be the output of the following statements ?
int a = 5, b = 2, c = 10, i = a>b
void main()
{ printf(“hello”); main(); }
infinite number of times
19. Which of the following shows the correct hierarchy of arithmetic operations in C ?
-
(), *, * or /, + or -
(), **, *, /, +, -
(), *, /, *, +, -
20. Which is the correct way to declare a pointer?
-
int_ptr;
int *ptr;
*int ptr;
21. The string is actually stored as an array of ……. the null character …… is automatically placed at the end of a string to act as a string ……..
-
Constants, \n, terminator
Characters, \0, terminator
Character, \t, initialize
22. Which function converts a string of digits into its numeric equivalent
-
atan()
atoi()
calloc()
23. The expression x = 4+2% -8 evaluates to -
-
-6,
6,
4,
24. ______ is an example of compile time polymorphism
-
Virtual function
Member function
Function overloading
25. What will be the output of the following statements ?
int x[4] = {1,2,3}; printf(“%d %d %D”,x[3],x[2],x[1]);
-
03%D
26. The library function exit() causes an exit from
-
the loop in which it appears,
the block in which it appears,
the function in which it appears,
27. In C++ array subscript always starts with
28. What is the output of the following code?
#include
void main()
{
int s=0;
while(s++<10)>
# define a 10
main()
{
printf(“%d..”,a);
foo();
printf(“%d”,a);
}
void foo()
{
#undef a
#define a 50
}
-
10..10
10..50
Error
29. char a = 321; printf("%c", a), then the output will be
30. What will be output if you will compile and execute the following c code?
void main(){
int i=0;
if(i==0){
i=((5,(i=3)),i=1);
printf(“%d”,i);
}
else
printf(“equal”);
}
Post a Comment
0 Comments