Functions in C are ALWAYS:
Global variables are:
Which of the following are an external variable?
int func (int a)
{
int b;
return b;
}
int main()
{
int c;
func (c);
}
int d;
What will be the output?
int main()
{
printf("%d", d++);
}
int d = 10;
What will be the output?
double var = 8;
int main()
{
int var = 5;
printf("%d", var);
}
What is the output of this C code?
double i;
int main()
{
printf("%g\n",i);
return 0;
}
Which part of the program address space is p stored in the code given below?
int *p = NULL;
int main()
{
int i = 0;
p = &i;
return 0;
}
Which part of the program address space is p stored in the code given below?
int *p;
int main()
{
int i = 0;
p = &i;
return 0;
}
Can variable i be accessed by functions in another source file?
int i;
int main()
{
printf("%d\n", i);
}
Property of external variable to be accessed by any source file is called by C90 standard as:
What is the output of this C code?
int *i;
int main()
{
if (i == NULL)
printf("true\n");
return 0;
}
What is the output of this C code?
int *i;
int main()
{
if (i == 0)
printf("true\n");
return 0;
}
What is the output of this C code?
static int x = 5;
void main()
{
x = 9;
{
int x = 4;
}
printf("%d", x);
}