adplus-dvertising

Welcome to the Strings MCQs Page

Dive deep into the fascinating world of Strings with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Strings, a crucial aspect of C Programming. In this section, you will encounter a diverse range of MCQs that cover various aspects of Strings, from the basic principles to advanced topics. Each question is thoughtfully crafted to challenge your knowledge and deepen your understanding of this critical subcategory within C Programming.

frame-decoration

Check out the MCQs below to embark on an enriching journey through Strings. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of C Programming.

Note: Each MCQ comes with multiple answer choices. Select the most appropriate option and test your understanding of Strings. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

Strings MCQs | Page 12 of 14

Q111.
What is the output of C program with strings?
int main()
{
    char str[2];
    scanf("%s", str);
    printf("%s",str);
    return 0;
}
//Input: South
Discuss
Answer: (b).South
Q112.
What is the output of C Program with strings?
int main()
{
    char str[2];
    int i=0;
    scanf("%s", str);
    while(str[i] != '\0')
    {
        printf("%c", str[i]);
        i++;
    }
    return 0;
}
//Input: KLMN
Discuss
Answer: (b).KLMN
Q113.
What is the output of C Program with String Pointer?
int main()
{
    char country[]="BRAZIL";
    char *ptr;
    ptr=country;
    while(*ptr != '\0')
    {
        printf("%c", *ptr);
        ptr++;
    }
    return 0;
}
Discuss
Answer: (b).BRAZIL
Q114.
How do you accept a Multi Word Input in C Language?
Discuss
Answer: (b).GETS
Discuss
Answer: (d).All of the above
Q116.
What is the output of C Program with String Pointers?
int main()
{
    char *p1 = "GOAT";
    char *p2;
    p2 = p1;
    printf("%s", p2);
}
Discuss
Answer: (b).GOAT
Q117.
What is the output of C Program with String arrays?
int main()
{
    char *p1 = "GOAT";
    char *p2;
    p2 = p1;
    p2="ANT";
    printf("%s", p1);
}
Discuss
Answer: (b).GOAT
Q118.
What is the output of C Program with String Arrays?
int main()
{
    char p[] = "GODZILLA";
    int i=0;
    while(p[i] != '\0')
    {
        printf("%c",*(p+i));
        i++;
    }
}
Discuss
Answer: (b).GODZILLA
Q119.
What is the ASCII value of NULL or \0?
Discuss
Answer: (a).0
Q120.
A character constant is enclosed by
Discuss
Answer: (b).Right Single Quotes

Suggested Topics

Are you eager to expand your knowledge beyond C Programming? We've curated a selection of related categories that you might find intriguing.

Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!