Examveda

What will be the output of the following C code?
#include <stdio.h>
struct temp
{
    int a;
} s;
void change(struct temp);
main()
{
    s.a = 10;
    change(s);
    printf("%d\n", s.a);
}
void change(struct temp s)
{
    s.a = 1;
}

A. Output will be 1

B. Output will be 10

C. Output varies with machine

D. Compile time error

Answer: Option B


This Question Belongs to C Program >> Structure And Union

Join The Discussion

Related Questions on Structure and Union