Which of the following is the right syntax to copy n characters from the object pointed to by s2 into the object pointed to by s1?
A. void *memcpy(void *s1,const void *s2,size_t n);
B. void *memcpy(void *s2, const void *s1, size_t n);
C. void memcpy(void *s1,const void *s2, size_t n);
D. void memcpy(void *s2,const void *s1,size_t n);
Select an option to see the answer and solution.
The isdigit function tests for any decimal-digit character.
Select an option to see the answer and solution.
which of the following function returns a pointer to the located string or a null pointer if string is not found.
A. strtok()
B. strstr()
C. strspn()
D. strrchr()
Select an option to see the answer and solution.
void *memcpy(void *dest, const void *src, size_t n) What does the following code do?
A. copies n characters from src to dest
B. copies n character from dest to src
C. transform n character from dest to src
D. transform n character from src to dest
Select an option to see the answer and solution.
What will be the output of the following C code?
errno = 0;
y = sqrt(-10);
if(errno == EDOM)
printf("Invalid value \n");
else
printf("Valid value\n");A. Invalid value
B. Valid value
C. No output
D. Compile error
Select an option to see the answer and solution.
This function checks whether the passed character is white-space.
A. ispunct()
B. isgraph()
C. isspace()
D. isalpha()
Select an option to see the answer and solution.
What is the function of strcoll()?
A. compares the string, result is dependent on the LC_COLLATE
B. copies the string, result is dependent on the LC_COLLATE
C. compares the string, result is not dependent on the LC_COLLATE
D. copies the string, result is not dependent on the LC_COLLATE
Select an option to see the answer and solution.
isalpha() function is used to detect characters both in uppercase and lowercase.
Select an option to see the answer and solution.
Which header declares several functions useful for testing and mapping characters?
A. assert.h
B. stdio.h
C. ctype.h
D. errno.h
Select an option to see the answer and solution.
What will be the output of the following C code?
int i = 0;
char c;
char str[ ] = "Little Star";
while(str[i])
{
putchar (toupper(str[i]));
i++;
}A. little star
B. lITTLE sTAR
C. LITTLE STAR
D. Little Star
Select an option to see the answer and solution.
What occurs when a result has nowhere near the number of significant digits indicated by its type.
A. domain
B. underflow
C. overflow
D. significance loss
Select an option to see the answer and solution.
The function strsp() is the complement of strcspn().
Select an option to see the answer and solution.
NULL is the macro defined in the header string. h.
Select an option to see the answer and solution.
The strpbrk() function is used to return a pointer to the character, or a null pointer if no character from s2 occurs in s1.
Select an option to see the answer and solution.
What will be the output of the following C code?
const char str1[]="ABCDEF1234567";
const char str2[] = "269";
len = strcspn(str1, str2);
printf("First matching character is at %d\n", len + 1);A. First matching character is at 8
B. First matching character is at 7
C. First matching character is at 9
D. First matching character is at 12
Select an option to see the answer and solution.
What will be the output of the following C code?
char str1[15];
char str2[15];
int mat;
strcpy(str1, "abcdef");
strcpy(str2, "ABCDEF");
mat= strncmp(str1, str2, 4);
if(mat< 0)
printf("str1 is not greater than str2");
else if(mat> 0)
printf("str2 is is not greater than str1");
else
printf("both are equal");A. str1 is not greater than str2
B. str2 is not greater than str1
C. both are equal
D. error in given code
Select an option to see the answer and solution.
The . . . . . . . . function returns a pointer to the first character of a token.
A. strstr()
B. strcpy()
C. strspn()
D. strtok()
Select an option to see the answer and solution.
The mem functions are meant for . . . . . . . .
A. returning a pointer to the token
B. manipulating objects as character arrays
C. returning a pointer for implemented-defined string
D. returning a pointer to first occurrence of string in another string
Select an option to see the answer and solution.
What will the given C code do?
int memcmp(const void *str1, const void *str2, size_t n)A. compares the first n bytes of str1 and str2
B. copies the first n bytes of str1 to str2
C. copies the first n bytes of str2 to str1
D. invalid function
Select an option to see the answer and solution.
Which code from the given option return pointer to last occurrence of c in ch or NULL if not present?
A. char *strchr(ch, c)
B. char *strrchr(ch, c)
C. char *strncat(ch, c)
D. char *strcat(ch, c)
Select an option to see the answer and solution.