Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

QUESTION 15 What will be the output of following code? #include #include int main() { static char str1[] = cester; static char str2[20]; static char

QUESTION 15

  1. What will be the output of following code?

    #include

    #include

    int main()

    {

    static char str1[] = "cester";

    static char str2[20];

    static char str3[] = "Wor";

    int i;

    i = strcmp(strcat(str3, strcpy(str2, str1)), "Worcester");

    printf("%d", i);

    return 0;

    }

    A.

    1

    B.

    -1

    C.

    2

    D.

    0

2 points

QUESTION 16

  1. What will be the output of following statements?

    char s[25] = "Hello";

    int i=0;

    char ch;

    ch = s[++i];

    printf("%c", ch);

    ch = s[i++];

    printf("%c", ch);

    A.

    el

    B.

    ll

    C.

    ee

    D.

    He

2 points

QUESTION 17

  1. What will be the output of following statements?

    int i;

    char a[] = "";

    if(printf("%s", a))

    printf("The string is empty");

    else

    printf("The string is not empty");

    A.

    The string is empty

    B.

    The string is not empty

    C.

    No output

    D.

    0

2 points

QUESTION 18

  1. What will be the output of following statements?

    char str1[] = "Hello";

    char str2[] = "Hello";

    if(str1 == str2)

    printf("Equal");

    else

    printf("Unequal");

    A.

    Equal

    B.

    Unequal

    C.

    Error

    D.

    None of the above

2 points

QUESTION 19

  1. What will be the output of following statement?

    printf("%c", "abcdefgh"[4]);

    A.

    Run-time Error

    B.

    Compile-time Error

    C.

    e

    D.

    abcdefgh

2 points

QUESTION 20

  1. What will be the output of following program?

    #include

    int fun(int);

    int main()

    {

    float k=3;

    fun(k=fun(fun(k)));

    printf("%f", k);

    return 0;

    }

    int fun(int i)

    {

    i++;

    return i;

    }

    A.

    3.000000

    B.

    5.000000

    C.

    4.000000

    D.

    6.000000

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Graph Database Modeling With Neo4j

Authors: Ajit Singh

2nd Edition

B0BDWT2XLR, 979-8351798783

More Books

Students also viewed these Databases questions