Point out the error in the following program.
#include
int main()
{
char str[] = "IndiaBIX";
printf("%.#s %2s", str, str);
return 0;
}
Answer: D
No answer description available for this question.
Enter details here
What will be the output of the program?
#include
#include
int main()
{
char dest[] = {97, 97, 0};
char src[] = "aaa";
int i;
if((i = memcmp(dest, src, 2))==0)
printf("Got it");
else
printf("Missed");
return 0;
}
Answer: B
memcmp compares the first 2 bytes of the blocks dest and src as unsigned chars. So, the ASCII value of 97 is 'a'.
if((i = memcmp(dest, src, 2))==0) When comparing the array dest and src as unsigned chars, the first 2 bytes are same in both variables.so memcmp returns '0'.
Then, the if(0=0) condition is satisfied. Hence the output is "Got it".
Enter details here
Point out the error in the following program.
#include
int main()
{
fprintf("IndiaBIX");
printf("%.ef", 2.0);
return 0;
}
Answer: B
No answer description available for this question.
Enter details here
What is stderr ?
Answer: C
No answer description available for this question.
Enter details here
MB_CUR_MAX is not defined in stdlib.h.
Answer: B
MB_CUR_MAX is defined under header file stdlib.h .
MB_CUR_MAX expands into a positive integer expression.It is the maximum number of bytes in a multibyte character present in the current locale.
Enter details here
Which standard library function will you use to find the last occurrence of a character in a string in C?
Answer: D
No answer description available for this question.
Enter details here
What will be the output of the program?
#include
#include
int main()
{
char dest[] = {97, 97, 0};
char src[] = "aaa";
int i;
if((i = memcmp(dest, src, 2))==0)
printf("Got it");
else
printf("Missed");
return 0;
}
Answer: B
No answer description available for this question.
Enter details here
Input/output function prototypes and macros are defined in which header file?
Answer: C
No answer description available for this question.
Enter details here
What will be the output of the program?
#include
#include<math.h>
int main()
{
float i = 2.5;
printf("%f, %d", floor(i), ceil(i));
return 0;
}
Answer: C
No answer description available for this question.
Enter details here
The _______ function sorts an array of objects
Answer: D
No answer description available for this question.
Enter details here