Functions And Pointer - C Programming MCQ
31. What is the output of this program?
#include <stdio.h>
void main()
{
int arr[3] = {1, 2, 3};
int *ptr = arr;
int **temp = &ptr ;
printf("%p %p", *temp, arr);
}
View Answer
32. The pointer ptr points to which string?
char *ptr;
char myString[]="letsfind";
ptr=myString
ptr+=5;
View Answer
33. What will be the output ?
void main()
{
char far *farther, *farthest;
printf("%d %d", sizeof(farther), sizeof(farthest));
}
View Answer
34. What is the output of this program?
#include <stdio.h>
void test(int * , int *);
void main()
{
int a = 5 , b = 6;
test(&a,&b);
printf("%d %d",a,b);
}
void test(int *p, int *q)
{
*p = *p * *q;
*q = *p + *q;
*p = *p - *q;
}
View Answer
35. Will the program compile?
#include<stdio.h>
int main()
{
char str[5] = "Letsfind";
return 0;
}
View Answer
36. Are the three declarations char **apple, char *apple[], and char apple[][] same?
View Answer
37. Is the NULL pointer same as an uninitialised pointer?
View Answer
38. Which of the following statements correct about k used in the below statement?
char ****k;
View Answer
39. Is there any difference between the following two statements?
char *p=0;
char *t=NULL;
View Answer
40. Is this a correct way for NULL pointer assignment?
int i=0;
char *q=(char*)i;
View Answer
Also check :