adplus-dvertising
frame-decoration

Question

Point out the error in the program (in Turbo-C).
#include<stdio.h>
#define MAX 128

int main()
{
    const int max=128;
    char array[max];
    char string[MAX];
    array[0] = string[0] = 'A';
    printf("%c %c\n", array[0], string[0]);
    return 0;
}

a.

Error: unknown max in declaration/Constant expression required

b.

Error: invalid array string

c.

None of above

d.

No error. It prints A A

Answer: (a).Error: unknown max in declaration/Constant expression required

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 (in Turbo-C).