void main()
{
int a;
int &b = a;
a=100;
printf("b=%d\ta=%d
", b,a);
}
b=100 a=100
b=100 a=0
b=0 a=100
Error
D. Error
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
do-while
if-else
goto
for
True
False
True
False
for
while
do-while
while & do-while
True
False
Positive value
Zero
Negative value
None of these
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.
True
False
the return 0; statement
the first statement after the loop
the statement following the continue statement
the next iteration of the loop
True
False
while (1)
{i++;}
for( ; ; );
while (true)
{false = 1;}
do
{y = x;}
while (x==0);
Keywords have some predefine meanings and these meanings can be changed.
Keywords have some unknown meanings and these meanings cannot be changed.
Keywords have some predefine meanings and these meanings cannot be changed.
None of the above
True
False
Only once
At least once
More than Once
Any one of the above
void change (char *k)
{
k="Hello";
return;
}
main()
{
char *ch = "World";;
change(ch);
printf("%s", ch);
}
Hello
World
Compilation error
Hello World
1 byte
4 bytes
8 bytes
16 bytes
True
False
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
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);
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
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
std::bad_creat
std::bad_alloc
std::bad_cast
std::bad_typeid
?,-
?,:
++<--
none of the above
True
False
main()
{
int a = 0;
for (; i = 0; i++)
printf("%d", a);
}
0
Nothing will be displayed
Infinite loop
None of the above
float
string
int
wchar_t
True
False
True
False