Examveda

What will be the output of the following C code?
#include <stdio.h>
void foo(const int *);
int main()
{
    const int i = 10;
    printf("%d ", i);
    foo(&i);
    printf("%d", i);

}
void foo(const int *i)
{
    *i = 20;
}

A. Compile time error

B. 10 20

C. Undefined value

D. 10

Answer: Option A


This Question Belongs to C Program >> C Fundamentals

Join The Discussion

Related Questions on C Fundamentals