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

Q81.
Which of the following gives the memory address of the first element in array foo, an array with 10 elements?
Discuss
Answer: (a).foo
Q82.
What is the output of this program?
#include <stdio.h>
void main(){
char c[] = "GATE2011"; 
char *p =c; 
printf("%s", p + p[3] - p[1]);
}
Discuss
Answer: (c).2011
Q83.
What is the output of this program?
#include <stdio.h>
#include<string.h>
void main()
{
    char s1[20] = "Hello", s2[10] = " World";
    printf("%s", strcpy(s2, strcat(s1, s2)));
}
Discuss
Answer: (a).Hello World
Q84.
How many times the loop will execute ?
#include <stdio.h>
int main()
{
    char str[10] = "98765", *p;
    p = str + 1;
    *p = '0' ;
    printf ("%s", str);
}
Discuss
Answer: (d).90765
Q85.
What is the output of this program?
#include <stdio.h>
void main()
{
    char s[] = "Compsci Edu";
    printf("%s", str);
}
Discuss
Answer: (c).Compsci
Q86.
What is the output of this program?
#include <stdio.h>
int main()
{
    char str[10] = "Compsciedu";
    printf("%s", str);
    return 0;
}
Discuss
Answer: (a).Compsciedu
Q87.
What is the output of the given code ?
#include <stdio.h>
int main()
{
    int i;
    char str[] = "";
    if(printf("%s", str))
        printf("Empty String");
    else
        printf("String is not empty");
    return 0;
}
Discuss
Answer: (b).String is not empty
Q88.
What is the output of this program?
#include <stdio.h>
int main()
{
    char str = "Hello";
    printf("%s", str);
    return 0;
}
Discuss
Answer: (c).Segmentation Fault
Q89.
What is the output of this program?
#include <stdio.h>
int main()
{
    char s1[] = "Hello";
    char s2[] = "Hello";
    if(s1 == s2)
        printf("Same");
    else
        printf("Not Same");
    return 0;
}
Discuss
Answer: (a).Not Same
Q90.
What will be the output of the program ?
#include <stdio.h>
int main(void)
{
    char p;
 char buf[10]={1,2,3,4,5,6,9,8};
    p=(buf+1)[5];
        printf("%d",p);
   
    return 0;
}
Discuss
Answer: (c).9

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!