adplus-dvertising
frame-decoration

Question

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;
}

a.

Empty String

b.

String is not empty

c.

0

d.

None of the above

Posted under C Programming

Answer: (b).String is not empty

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of the given code ?