#include
int main(){
int i=320;
char *ptr=(char *)&i;
printf("%d",*ptr);
return 0;
}
1
64
320
Compiler Error
B. 64
As we know size of int data type is two byte while char pointer can pointer one byte at time.
So char pointer ptr is pointing to only first byte as shown above figure.
*ptr i.e. content of first byte is 01000000 and its decimal value is 64.
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
void main()
{
char a = 'B';
switch (a)
{
case 'A' : printf("a");
case 'B' : printf("b");
default : printf("c");
}
B
b
bca
bc
Simple Template Library
Standard Template Library
Static Type Library
Single Type-based Library
**, * or /, + or -
**, *, /, +, -
**< /< *< +<-
/ or *, - or +
?,-
?,:
++<--
none of the above
while (1)
{i++;}
for( ; ; );
while (true)
{false = 1;}
do
{y = x;}
while (x==0);
main()
{
int a = 5, b = 6;
(a == b? printf("%d", a));
}
0
5
Error
None of the above
The smallest individual units of c program
The basic element recognized by the compiler
The largest individual units of program
A & B Both
They begin with a hash symbol
They are processed by a preprocessor
They form an integral part of the code
They have to end with a semi colon
True
False
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
True
False
Positive value
Zero
Negative value
None of these
main()
{
int a = 0;
for (; i = 0; i++)
printf("%d", a);
}
0
Nothing will be displayed
Infinite loop
None of the above
True
False
True
False
float a =123.56;
char ch ='T' * 'A';
char ch ='T' *20;
3 +a = b;
string.h
strings.h
text.h
strcmp.h
3
4
5
infinite
True
False
the return 0; statement
the first statement after the loop
the statement following the continue statement
the next iteration of the loop
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
An Editor
A compiler
An operating system
None of the above
True
False
True
False
True
False