Pointers
- What will be the output of the following C code?
#include <stdio.h>
void main()
{
char *str = "PRAYAG";
char *ptr = str;
printf("%c %c", *ptr, str[2]);
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
P A
- What will be the output of the following C code?
#include <stdio.h>
void main()
{
char *str = "AJIT";
char *ptr = str;
printf("%c %c", *(ptr + 2), str[2]);
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
I I
- Which of following logical operation can be applied to pointers?
(Assuming initialization int *p = 12; int *q = 13;)
-
View Hint View Answer Discuss in Forum
NA
Correct Option: E
None of these
- What is the size of *p in a 32-bit machine (Assuming initialization as int *p = 12;)?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
4
- Which of the following arithmetic operation can be applied to pointers p and q?
(Assuming initialization as int *p = (int *)6; int *q = (int *)7;)
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
p – q