adplus-dvertising
frame-decoration

Question

What will be the output of the program?
#include<stdio.h>

int main()
{
    const char *s = "";
    char str[] = "Hello";
    s = str;
    while(*s)
        printf("%c", *s++);

    return 0;
}

a.

Error

b.

H

c.

Hello

d.

Hel

Posted under C Programming

Answer: (c).Hello

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What will be the output of the program?