#include
int main()
{
float a=5.2;
if(a==5.2)
printf("Equal");
else if(a<5.2)
printf("Less than");
else
printf("Greater than");
return 0;
}
Less than
Equal
Greater than
None of above
void main()
{
int a = 20;
printf("%d\t%d
", ++a, a);
}
21 21
20 21
21 20
20 20
1 byte
4 bytes
8 bytes
16 bytes
True
False
True
False
putchar(65)
putchar('x')
putchar("x")
')
24
2
26
None
printf("%d%d", book.price, book.page);
printf("%d%d", price.book, page.book);
printf("%d%d"< price::book< page::book);
printf("%d%d", price>book, page>book);
True
False
float
string
int
wchar_t
void main()
{
char a = 'B';
switch (a)
{
case 'A' : printf("a");
case 'B' : printf("b");
default : printf("c");
}
B
b
bca
bc
True
False
''
" "
'a'
abc'
to go to the next iteration in a loop
come out of a loop
exit and return to the main function
restarts iterations from beginning of loop
True
False
True
False
the question mark should be an equal sign
the first semicolon should be a colon
there are too many variables in the statement
the conditional operator is only used with apstrings
a = 5
a += 5
a = b = c
a = b
4
2
8
10
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.
Type definitions (typedefs)
Class definitions
Function definitions
Template definitions
Sequential
Random
Sequential and Random
None of the above
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
\a
\b
\m
abstract
Virtual
Dynamic
Typeid
main()
{
xyz: goto abc;
printf("Hello");
abc: printf("World");
goto xyz;
}
Infinite loop
Hello World
World Hello
Compilation error
True
False
void change (char *k)
{
k="Hello";
return;
}
main()
{
char *ch = "World";;
change(ch);
printf("%s", ch);
}
Hello
World
Compilation error
Hello World
True
False
True
False