You are not logged in.

#1 2015-09-12 06:57:35

hasnain
Administrator
From: Chichawatni
Registered: 2014-10-13
Posts: 8,355
Website

Sample Code:

http://interviewquestionsanswers.org/quiz/C-Programming http://interviewquestionsanswers.org/qu … ge-Pointer

Directions:
What will be printed when the sample code above is executed?

Question:
char* myfunc(char *ptr)
{
   ptr+=3;
   return(ptr);
}

void main()
{
   char *x, *y;
   x = "EXAMVEDA";
   y = myfunc(x);
   printf("y=%s", y);
}

Option A):
y=AMVEDA
Option B):
y=VEDA
Option C):
y=MVEDA
Option D):
y=EXAMVEDA

Correct Answer is Option C):
y=MVEDA


Failure is the first step towards seccess.

2015-09-12 06:57:35

Advertisement
Ads By Google

Re: Sample Code:



Board footer