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);
Answer: A
size_t strcspn(const char *str1, const char *str2) is used to calculate the length of the initial segment of str1, which consists entirely of characters not in str2.
Enter details here
Which of the given function is used to return a pointer to the located character?
Answer: D
The strchr() function is used to return a pointer to the located character if character does not occur then a null pointer is returned.
Enter details here
String operation such as strcat(s, t), strcmp(s, t), strcpy(s, t) and strlen(s) heavily rely upon.
Answer: A
No answer description available for this question.
Enter details here
How will you print \n on the screen?
Answer: D
No answer description available for this question.
Enter details here
If the two strings are identical, then strcmp() function returns
Answer:
Enter details here
The______function returns a pointer to the first character of a token.
Answer: D
The strtok() function returns a pointer to the first character of a token, if there is no token then a null pointer is returned.
Enter details here
Strcat() function adds null character.
Answer: B
No answer description available for this question.
Enter details here
Which of the following function compares 2 strings with case-insensitively?
Answer: C
No answer description available for this question.
Enter details here
What will be the output of the program ?
#include
int main()
{
printf(5+"IndiaBIX\n");
return 0;
}
Answer: C
No answer description available for this question.
Enter details here
What will be the output of the program ?
#include
int main()
{
char str[25] = "IndiaBIX";
printf("%s\n", &str+2);
return 0;
}
Answer: A
No answer description available for this question.
Enter details here