Which of the following are correct syntaxes to send an array as a parameter to function:
Answer: B
No answer description available for this question.
Enter details here
What will be the output of the program ?
#include
int main()
{
int i=3, *j, k;
j = &i;
printf("%d\n", i**j*i+*j);
return 0;
}
Answer: A
No answer description available for this question.
Enter details here
What is the output of this C code?
int x = 0;
void main()
{
int *ptr = &x;
printf("%p\n", ptr);
x++;
printf("%p\n ", ptr);
}
Answer: A
No answer description available for this question.
Enter details here
What will be the output of the program?
#include
int main()
{
int arr[3] = {2, 3, 4};
char *p;
p = arr;
p = (char*)((int*)(p));
printf("%d, ", *p);
p = (int*)(p+1);
printf("%d", *p);
return 0;
}
Answer: B
No answer description available for this question.
Enter details here
Will the following program give any warning on compilation in TurboC (under DOS)?
#include
int main()
{
int *p1, i=25;
void *p2;
p1=&i;
p2=&i;
p1=p2;
p2=p1;
return 0;
}
Answer: B
No answer description available for this question.
Enter details here
What will be the output of the program ?
#include
int main()
{
int x=30, *y, *z;
y=&x; /* Assume address of x is 500 and integer is 4 byte size */
z=y;
*y++=*z++;
x++;
printf("x=%d, y=%d, z=%d\n", x, y, z);
return 0;
}
Answer: D
No answer description available for this question.
Enter details here
What will be the output of the program ?
#include
int *check(static int, static int);
int main()
{
int *c;
c = check(10, 20);
printf("%d\n", c);
return 0;
}
int *check(static int i, static int j)
{
int *p, *q;
p = &i;
q = &j;
if(i >= 45)
return (p);
else
return (q);
}
Answer: D
No answer description available for this question.
Enter details here
Point out the compile time error in the program given below.
#include
int main()
{
int *x;
*x=100;
return 0;
}
Answer: C
No answer description available for this question.
Enter details here
What is the output of this C code?
void main()
{
int a[3] = {1, 2, 3};
int *p = a;
int **r = &p;
printf("%p %p", *r, a);
}
Answer: C
No answer description available for this question.
Enter details here
What will be the output of the program?
#include
int main()
{
int arr[2][2][2] = {10, 2, 3, 4, 5, 6, 7, 8};
int *p, *q;
p = &arr[1][1][1];
q = (int*) arr;
printf("%d, %d\n", *p, *q);
return 0;
}
Answer: A
No answer description available for this question.
Enter details here