Think Python
Think Python
30.11.2017
11. In the given below statement, what does the “pf” indicate?
int (*pf)();
A - pf is a pointer of a function which return int
B - pf is a pointer
C - pf is a function pointer
D - None of the above
12. What is the size of the following union definition?
#include<stdio.h>
union abc {
char a,b,c,d,e,f,g,h;
int i;
}abc;
main()
{
printf( "%d", sizeof( abc ));
}
A - 1
B - 2
C - 4
D - 8
main()
{
#undef NULL
char *s = "Hello";
while(*s != NULL)
{
printf("%c", *s++);
}
}
A - Hello
B - Compile error: there is no macro called “undef”
C - Compile error: improper place of #undef
D - Compile error: NULL is undeclared.
14. Choose the correct function which can return a reminder by dividing -
10.0/3.0?
A - rem = mod(-10.0, 3.0);
B - rem = fmod(-10.0, 3.0);
C - rem = modf(-10.0, 3.0);
D - Division of floating point values can’t return reminder
15. If, the given below code finds the length of the string then what
will be the length?
#include<stdio.h>
int xstrlen(char *s)
{
int length = 0;
while(*s!='\0')
{length++; s++;}
return (length);
}
int main()
{
char d[] = "IndiaMAX";
printf("Length = %d\n", xstrlen(d));
return 0;
}
A - Code returns error
B - Code returns the length 8
C - Code returns the length 6
D - Code returns the length 2