Top

Strings

Answer: A

The strcoll() function compares the string s1 to the string s2, both interpreted as appropriate to the LC_COLLATE category of the current locale.

Enter details here

82.

#include 
int main() 
{ 
    char str[] = "GeeksQuiz"; 
    printf("%s %s %s\n", &str[5], &5[str], str+5); 
    printf("%c %c %c\n", *(str+6), str[6], 6[str]); 
    return 0; 
} 

 

Answer: D

No answer description available for this question.
 

Enter details here

83.

Assume that a character takes 1 byte. Output of following program?

#include 
int main() 
{ 
    char str[20] = "GeeksQuiz"; 
    printf ("%d", sizeof(str)); 
    return 0; 
} 

 

Answer: C

No answer description available for this question.
 

Enter details here

84.

Output?

int main() 
{ 
    char a[2][3][3] = {'g','e','e','k','s','q','u','i','z'}; 
    printf("%s ", **a); 
    return 0; 
} 

 

Answer: C

No answer description available for this question.
 

Enter details here

85.

What type of return-type used in String operations?

Answer: D

No answer description available for this question.

Enter details here

86.

What will be the output of the program If characters 'a', 'b' and 'c' enter are supplied as input?

#include

int main()
{
    void fun();
    fun();
    printf("\n");
    return 0;
}
void fun()
{
    char c;
    if((c = getchar())!= '\n')
        fun();
    printf("%c", c);
}

 

Answer: D

No answer description available for this question.

Enter details here

87.

What will be the output of the program ?

#include

int main()
{
    printf("India", "BIX\n");
    return 0;
}

 

Answer: C

No answer description available for this question.

Enter details here

88.

What will be returned in the following C code?

size- t strlen(const char *s)
const char *sc;
for(sc = s; *sc!= ' \ O ' ; ++sc)
return(sc - s) ;

 

Answer: B

The strlen() function is used to return the length of the string s.

Enter details here

89.

What will be the output of the program (Turbo C in 16 bit platform DOS) ?

#include
#include

int main()
{
    char *str1 = "India";
    char *str2 = "BIX";
    char *str3;
    str3 = strcat(str1, str2);
    printf("%s %s\n", str3, str1);
    return 0;
}

 

Answer: B

No answer description available for this question.

Enter details here

90.

This function offers the quickest way to determine whether two character sequences of the same known length match character for the character up to and including any null character in both.

Answer: C

The strncmp() function is used to compare not more than n characters (characters that follow a null character are not compared) from the array pointed to by one, to the array pointed to by other.

Enter details here

Loading…
Tags: Strings Questions and Answers || Strings MCQ Questions and Answers || Strings GK Questions and Answers || Strings GK MCQ Questions || Strings Multiple Choice Questions and Answers || Strings GK || GK on Strings || C Programming Questions and Answers || C Programming MCQ Questions and Answers || C Programming GK Questions and Answers || GK on C Programming