Note 1

Take Note:

Take a note while surfing.





Note With Ink

Give your Note a Colorful Tag.




Easy to Access

Stay on same information and in Sync wherever you are.

Note 2

Take Note:

Organize your information,It may take Shape.





Think With Ink

Differ your Content by Color.




Easy to Access

Easy to pull up your content from anywhere anytime.

Note 3

Take Note:

Don't Let information to miss,Because it take shape





Note With Ink

Simple an Easy Way to take a note.




Easy to Access

Get the same in next visit.


Please wait...

C Programming :: Pointers

Home > C Programming > Pointers > General Questions

21. What will be output of the following "c" code?

#include
void main()
{
int i = 257;
int *iPtr = &i;
printf("%d %d", *((char*)iPtr), *((char*)iPtr+1) );
}

Answer: Option A

Explanation:

The integer value 257 is stored in the memory as, 00000001 00000001, so the individual bytes are taken by casting it to char * and get printed.

Workspace


Tags:  No Tags on this question yet!

22. What will be output of the following "c" code?

#include
void main()
{
int i = 258;
int *iPtr = &i;
printf("%d %d", *((char*)iPtr), *((char*)iPtr+1) );
}

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace


Tags:  No Tags on this question yet!

23. What will be output of the following "c" code?

#include
void main()
{
char * str = "hello";
char * ptr = str;
char least = 127;
while (*ptr++)
least = (*ptr printf("%d",least);
}

Answer: Option D

Explanation:

After 'ptr' reaches the end of the string the value pointed by 'str' is '\0'. So the value of 'str' is less than that of 'least'. So the value of 'least' finally is 0.

Workspace


Tags:  No Tags on this question yet!

24. What is the output of the following 'C' program ?

#include
int main()
{
int a = 10,*j;
void *k;
j = &a;
k = &a;
*j++;
printf("%d",*j);
printf("%d" ,*k);
}

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace


Tags:  No Tags on this question yet!

25. What is the output of the following 'C' program ?

#include
enum {FALSE,TRUE};
int main()
{
int i=1;
do
{
printf("%d\n",i);
i++;
if(i < 5) continue; else
i = 4;
}while(TRUE);
return 0;
}

Answer: Option B

Explanation:

Here is no explanation for this answer

Workspace


Tags:  No Tags on this question yet!

26. The size of generic pointer in c is 2 __

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace


Tags:  nagarro

27. What will be output of the following "c" code?

#include
void main() {
char *p;
p = "Hello";
printf("%c", *&*p);
}

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace


Tags:  No Tags on this question yet!

28.  What will be output of the following "c" code?

#include
void main()
{
char *p= "Hai Friends", *p1;
p1= p;
while(*p != '\0')
++*p++;
printf("%s %s ", p, p1);
}

Answer: Option B

Explanation:

Here is no explanation for this answer

Workspace


Tags:  No Tags on this question yet!

29. The following C program fragment

void main()
{
int *a;
*a= 7;
}

Answer: Option D

Explanation:

Here is no explanation for this answer

Workspace


Tags:  No Tags on this question yet!

30. Prior to using a pointer variable it should be

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace


Tags:  No Tags on this question yet!