What will the code display on compiling?
void funccall()
{
printf("this is funccall\n");
}
void main ()
{
atexit(funccall);
printf("program starts\n");
printf("program ends\n");
}
Answer: C
int atexit(void (*func)(void)) calls the specified function func when the program terminates. we can register termination function anywhere in the program, but it will be called at the time of the program termination.
Enter details here
Which of the following functions returns a pointer to a string representing the date and time stored in a structure?
Answer: C
No answer description available for this question.
Enter details here
It is necessary that for the string functions to work safely the strings must be terminated with '\0'.
Answer: A
C string is a character sequence stored as a one-dimensional character array and terminated with a null character('\0', called NULL in ASCII).
The length of a C string is found by searching for the (first) NULL byte.
Enter details here
The macro definition of INT_MIN is ____________
Answer: A
No answer description available for this question.
Enter details here
Point out the error in the following program.
#include
#include
int main()
{
char str1[] = "Learn through Compscibits\0.com", str2[120];
char *p;
p = (char*) memccpy(str2, str1, 'i', strlen(str1));
*p = '\0';
printf("%s", str2);
return 0;
}
Answer: D
No answer description available for this question.
Enter details here
What will be the output of the program?
#include
int main()
{
int i;
char c;
for(i=1; i<=5; i++)
{
scanf("%c", &c); /* given input is 'b' */
ungetc(c, stdout);
printf("%c", c);
ungetc(c, stdin);
}
return 0;
}
Answer: C
No answer description available for this question.
Enter details here
What error occurs if an input argument is outside the domain over which the mathematical function is defined?
Answer: A
No answer description available for this question.
Enter details here
_______variable type defined in the header stdlib.h is an integer type of the size of a wide character constant.
Answer: B
No answer description available for this question.
Enter details here
Point out the error in the following program.
#include
#include
int main()
{
char str1[] = "Learn through IndiaBIX\0.com", str2[120];
char *p;
p = (char*) memccpy(str2, str1, 'i', strlen(str1));
*p = '\0';
printf("%s", str2);
return 0;
}
Answer: D
No answer description available for this question.
Enter details here
sqrt(x) function is not faster than the apparent equivalent pow(x,0.5).
Answer: B
No answer description available for this question.
Enter details here