An alphabet
A number
A special symbol other than underscore
both (b) and (c)
D. both (b) and (c)
Dennis Ritchie
Ken Thompson
Bill Gates
Peter Norton
True
False
break
continue
exit
All of the above
True
False
void main()
{
int a = 1, b=2;
int *ip;
ip=&a;
b=*ip;
printf("%d", b);
}
2
1
100
0
What will be output if you will compile and execute the following c code?
#include
int main(){
char c=125;
c=c+10;
printf("%d",c);
return 0;
}
135
+INF
-121
-135
main()
{
void msg()
{
printf("HELLO WORLD");
}
}
HELLO WORLD
Error
None of the above
Null
Type definitions (typedefs)
Class definitions
Function definitions
Template definitions
The smallest individual units of c program
The basic element recognized by the compiler
The largest individual units of program
A & B Both
/ + *
* / +
+ / *
* / + -
float a =123.56;
char ch ='T' * 'A';
char ch ='T' *20;
3 +a = b;
True
False
void main()
{
char a = 'B';
switch (a)
{
case 'A' : printf("a");
case 'B' : printf("b");
default : printf("c");
}
B
b
bca
bc
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.
True
False
True
False
#include
int main(){
int i=320;
char *ptr=(char *)&i;
printf("%d",*ptr);
return 0;
}
1
64
320
Compiler Error
''
" "
'a'
abc'
True
False
main()
{
int a[10], i;
for (i = 1; I <= 0; i++)
{
scanf("%d", a[i]);
printf("%d", a[i]);
}
}
10
Logical error
Runtime error
1 to 10 will be displayed
True
False
True
False
A
B
BCPL
C++
main()
{
int a = 0;
for (; i = 0; i++)
printf("%d", a);
}
0
Nothing will be displayed
Infinite loop
None of the above
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
An alphabet
A number
A special symbol other than underscore
both (b) and (c)
Throw by value and catch by reference.
Throw by reference and catch by reference.
Throw by value and catch by value
Throw the pointer value and provide catch for teh pointer type.
0
NULL
1
none of the above
void main()
{
int z, a = 5, b = 3; z = a * 2 + 26 % 3;
printf("%d", z); }
10
0
12
None of the above
True
False