In the given C snippet, find the statement number that has error.
//C code to push an element into a stack
void push( struct stack *s, int x)
{
if(s->top==MAX-1)
{
printf(“stack overflow”);
}
else
{
s->items[++s->top]=x;
s++;
}
}
//C code to push an element into a stack
void push( struct stack *s, int x)
{
if(s->top==MAX-1)
{
printf(“stack overflow”);
}
else
{
s->items[++s->top]=x;
s++;
}
}
A. 1
B. 9
C. 10
D. 11
Answer: Option C
Join The Discussion