General Knowledge :: Testing New
-
Determine Output:
void main()
{
char far *farther, *farthest;
printf("%d..%d", sizeof(farther), sizeof(farthest));
}
-
Determine Output:
main()
{
char *str1 = "abcd";
char str2[] = "abcd";
printf("%d %d %d", sizeof(str1), sizeof(str2), sizeof("abcd"));
}
-
Choose the best answer.
Prior to using a pointer variable -
Comment on the following pointer declaration?
int *ptr, p;
-
What will be the output?
main()
{
char *p;
p = "Hello";
printf("%cn",*&*p);
}
-
Determine output:
#include <stdio.h>
void main()
{
char *p = NULL;
char *q = 0;
if(p)
printf(" p ");
else
printf("nullp");
if(q)
printf("q");
else
printf(" nullq");
}
- The address operator &, cannot act on
- The statement int **a;
-
What will be the output of the following program?
#include<stdio.h>
void main()
{
int i = 10;
void *p = &i;
printf("%d\n", (int)*p);
}
-
What will be the output of the following program code?
#include<stdio.h>
void main()
{
int i = 10;
void *p = &i;
printf("%f", *(float *)p);
}