adplus-dvertising
frame-decoration

Question

Point out the error in the program.
#include<stdio.h>

int main()
{
    const int x;
    x=128;
    printf("%d\n", x);
    return 0;
}

a.

Error: unknown data type const int

b.

Error: const variable have been initialised when declared.

c.

Error: stack overflow in x

d.

No error

Posted under C Programming

Answer: (b).Error: const variable have been initialised when declared.

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Point out the error in the program.