Question 1
#include <stdio.h>
int var = 20;
int main()
{
int var = var;
printf("%d ", var);
return 0;
}
Question 2
Consider the program below in a hypothetical language which allows global variable and a choice of call by reference or call by value methods of parameter passing.
int i ;
program main ()
{
int j = 60;
i = 50;
call f (i, j);
print i, j;
}
procedure f (x, y)
{
i = 100;
x = 10;
y = y + i ;
}
Which one of the following options represents the correct output of the program for the two parameter passing mechanisms?
Call by value : i = 70, j = 10; Call by reference : i = 60, j = 70
Call by value : i = 50, j = 60; Call by reference : i = 50, j = 70
Call by value : i = 10, j = 70; Call by reference : i = 100, j = 60
Call by value : i = 100, j = 60; Call by reference : i = 10, j = 70
Question 3
Question 4
Question 5
Question 6
Question 7
#include "stdio.h"
int * gPtr;
int main()
{
int * lPtr = NULL;
if(gPtr == lPtr)
{
printf("Equal!");
}
else
{
printf("Not Equal");
}
return 0;
}
Question 8
Consider the following variable declarations and definitions in C
i) int var_9 = 1;
ii) int 9_var = 2;
iii) int _ = 3;
Choose the correct statement w.r.t. above variables.
Both i) and iii) are valid.
Only i) is valid.
Both i) and ii) are valid.
All are valid.
Question 9
int a;
int main()
{
int b;
// ..
// ..
}
int c;
Question 10
int main()
{
int x = 032;
printf("%d", x);
return 0;
}
There are 15 questions to complete.