void main()
{
char a = 'B';
switch (a)
{
case 'A' : printf("a");
case 'B' : printf("b");
default : printf("c");
}
B
b
bca
bc
D. bc
35
45
55
40
True
False
True
False
string.h
strings.h
text.h
strcmp.h
True
False
True
False
True
False
True
False
abstract
Virtual
Dynamic
Typeid
void main()
{
int a = 20;
printf("%d\t%d
", ++a, a);
}
21 21
20 21
21 20
20 20
void main()
{
int a = 1, b=2;
int *ip;
ip=&a;
b=*ip;
printf("%d", b);
}
2
1
100
0
void change (char *k)
{
k="Hello";
return;
}
main()
{
char *ch = "World";;
change(ch);
printf("%s", ch);
}
Hello
World
Compilation error
Hello World
4
2
8
10
True
False
What will be output if you will compile and execute the following c code?
#include
#define x 5+2
int main(){
int i;
i=x*x*x;
printf("%d",i);
return 0;
}
27
343
233
Compiler Error
3.4e38 to 3.4e38
32767 to 32768
32768 to 32767
32668 to 32667
True
False
int f(int a, int b);
void main()
{
int a = 12, b=154;
printf("%d", f(a, b));
}
int f(int a, int b)
{
if (a<b) return(f(b, a));
if(b==0) return(a);
return (f(b, a % b));
}
2
1
Compilation error
Runtime error
0
NULL
1
none of the above
x + y' is a keyword
3 and 20 are constants
3z is a constant
y is a variable and z is a constant
#define sqr(x= x*x)
main()
{
int a = 10, b = 5;
printf("%d, %d", sqr(a+b),sqr(++a));
}
77, 121
225, 121
77< 144
Compilation error
The smallest individual units of c program
The basic element recognized by the compiler
The largest individual units of program
A & B Both
Overloading is a dynamic or run-time binding and Overriding is static or compile-time binding
Redefining a function in a friend class is called function overriding while Redefining a function in a derived class is called a overloaded fucntion.
Overloading is a static or compile-time binding and Overriding is dynamic or run-time binding
Redefining a function in a friend class is called function overloading while Redefining a function in a derived class is called as overridden fucnion.
Explicit
Public
Implicit
Private
the increment should always be ++k
the variable must always be the letter i when using a for loop
there should be a semicolon at the end of the statement
the commas should be semicolons
True
False
True
False
main()
{
int sub[50];
for(i=0; i<=48;i++)
{
sub[i]=i;
printf("
%d", sub[i]);
}
}
0 to 48 will be displayed
48
49
Compilation Error
True
False
True
False