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 13 of 14

Discuss
Answer: (c).Sequential memory locations
Q122.
What is the output of C program with strings?
int main()
{
    char var='b';
    printf("%d ", sizeof("a"));
    printf("%d ", sizeof('b'));
    printf("%d ", sizeof(10));
    printf("%d ", sizeof(var));
}
//int size is 2 bytes
Discuss
Answer: (c).2 2 2 1
Q123.
What is the output of C program with strings?
int main()
{
    char str[]="JACKIE CHAN";
    int i=0;
    while(str[i] != 0)
    {
        printf("%c",str[i]);
        i++;
    }
    return 0;
}
Discuss
Answer: (b).JACKIE CHAN
Q124.
What is the output of C program with strings?
int main()
{
    char str[]="ANDAMAN";
    int i=0;
    while(str[i] != '\0')
    {
        printf("%c",str[i]);
        i++;
    }
    return 0;
}
Discuss
Answer: (b).ANDAMAN
Q125.
What is the output of C program with strings?
int main()
{
    char str[]="MALDIVES";
    printf("%s ",str);
    puts(str);
    return 0;
}
Discuss
Answer: (b).MALDIVES MALDIVES
Q126.
What is the output of C program with strings?
int main()
{
    char str[3]="SUNDAY";
    printf("%s",str);
}
Discuss
Answer: (b).SUNgarbagevalues
Discuss
Answer: (d).All of the above
Q128.
What is the output of C program?
int main()
{
    char str1[]="JAMES,";
    char str2[15]="BOND ";
    strcat(str2,str1);
    printf("%s",str2);
    printf("%s",str1);
}
Discuss
Answer: (c).BOND JAMES,JAMES,
Q129.
What is the output of C program?
int main()
{
    printf("%c","HUMPTY"[2]);
}
Discuss
Answer: (b).M
Q130.
What is the output of C program?
int main()
{
    char str1[] = "FIRST";
    char str2[20];
    strcpy(str2,str1);
    printf("%s %s ",str1,str2);
    printf("%d", (str1!=str2));
    printf("%d", strcmp(str1,str2));
    return 0;
}
Discuss
Answer: (c).FIRST FIRST 10

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!