Question 21
char *pChar;
int *pInt;
float *pFloat;
sizeof(pChar);
sizeof(pInt);
sizeof(pFloat);
Question 22
int* ptr1, ptr2;
Question 23
Consider the following C program.
#include<stdio.h>
void mystery(int *ptra, int *ptrb)
{
int *temp;
temp = ptrb;
ptrb = ptra;
ptra = temp;
}
int main()
{
int a=2016, b=0, c=4, d=42;
mystery(&a, &b);
if (a < c)
mystery(&c, &a);
mystery(&a, &d);
printf(\"%d", a);
}
The output of the program _____________ Note : This question was asked as Numerical Answer Type.
Question 24
int main() { int array[5][5]; printf("%d",( (array == *array) && (*array == array[0]) )); return 0; }
Question 25
int main() { int a = 300; char *b = (char *)&a; *++b = 2; printf("%d ",a); return 0; }Consider the size of int as two bytes and size of char as one byte. Predict the output of the following code . Assume that the machine is little-endian.
Question 26
void printxy(int x, int y) { int *ptr; x = 0; ptr = &x; y = *ptr; *ptr = 1; printf("%d,%d", x, y); }The output of the printxy(1,1) is
Question 27
int main() { int array[] = {3, 5, 1, 4, 6, 2}; int done = 0; int i; while (done == 0) { done = 1; for (i = 0; i <= 4; i++) { if (array[i] < array[i+1]) { swap(&array[i], &array[i+1]); done = 0; } } for (i = 5; i >= 1; i--) { if (array[i] > array[i-1]) { swap(&array[i], &array[i-1]); done = 0; } } } printf("%d", array[3]); }The output of the program is _____. Note: This question appeared as Numerical Answer Type.
Question 28
Question 29
‘ptrdata’ is a pointer to a data type. The expression *ptrdata++ is evaluated as (in C++) :
Question 30
A. Activation record | p. Linking loader |
B. Location counter | q. Garbage collection |
C. Reference counts | r. Subroutine call |
D. Address relocation | s. Assembler |
There are 43 questions to complete.