The mem functions are meant for _______
Answer: B
The mem functions is used for manipulating objects as character arrays.
Enter details here
What will be the output of the program ?
#include
int main()
{
static char s[25] = "The cocaine man";
int i=0;
char ch;
ch = s[++i];
printf("%c", ch);
ch = s[i++];
printf("%c", ch);
ch = i++[s];
printf("%c", ch);
ch = ++i[s];
printf("%c", ch);
return 0;
}
Answer: A
No answer description available for this question.
Enter details here
Output of following program
#include
int fun(char *p)
{
if (p == NULL || *p == '\0') return 0;
int current = 1, i = 1;
while (*(p+current))
{
if (p[current] != p[current-1])
{
p[i] = p[current];
i++;
}
current++;
}
*(p+i)='\0';
return i;
}
int main()
{
char str[] = "geeksskeeg";
fun(str);
puts(str);
return 0;
}
Answer: A
No answer description available for this question.
Enter details here
What does the following function returns void *memmove(void *s1,const void s2, size_t n);?
Answer: A
The memmove() function copies n characters from the object pointed to by s2 into the object pointed to by s1.The memmove() function returns the value of s1.
Enter details here
What is the return value of strxfrm()?
Answer: A
This function returns the length of the transformed string, not including the terminating null character.
Enter details here
Which among the given options compares atmost n characters of string ch to string s?
Answer: A
int strncmp(ch, s, n) is used to compare at most n characters of string ch to string s; return <0>s.
Enter details here
What will be the output of the program ?
#include
int main()
{
char str = "IndiaBIX";
printf("%s\n", str);
return 0;
}
Answer: A
No answer description available for this question.
Enter details here
What will be the output of the program ?
#include
void swap(char *, char *);
int main()
{
char *pstr[2] = {"Hello", "IndiaBIX"};
swap(pstr[0], pstr[1]);
printf("%s\n%s", pstr[0], pstr[1]);
return 0;
}
void swap(char *t1, char *t2)
{
char *t;
t=t1;
t1=t2;
t2=t;
}
Answer: C
No answer description available for this question.
Enter details here
What will be the output of the program in 16-bit platform (Turbo C under DOS) ?
#include
int main()
{
printf("%d, %d, %d", sizeof(3.0f), sizeof('3'), sizeof(3.0));
return 0;
}
Answer: B
No answer description available for this question.
Enter details here
What is the output of following program?
#include
void swap(char *str1, char *str2)
{
char *temp = str1;
str1 = str2;
str2 = temp;
}
int main()
{
char *str1 = "Geeks";
char *str2 = "Quiz";
swap(str1, str2);
printf("str1 is %s, str2 is %s", str1, str2);
return 0;
}
Answer: B
No answer description available for this question.
Enter details here