main()
{
char *ptr = "Ramco Systems";
(*ptr)++;
printf("%s\n",ptr);
ptr++;
printf("%s\n",ptr);
}
Find the Outputs?

Answer Posted / sumeet

Samco Systems
amco Systems

this will be the answer .. the reason being the ascii value
of r will be incremented so it now point to s( capital s
that is ) this account for (*ptr)++

next ptr++ will simply move you to the next charachter ..

Is This Answer Correct ?    20 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How will you declare an array of three function pointers where each function receives two ints and returns a float?

888


Write a program on swapping (100, 50)

762


What is the code for 3 questions and answer check in VisualBasic.Net?

1783


What is 'bus error'?

743


What could possibly be the problem if a valid function name such as tolower() is being reported by the C compiler as undefined?

869






What is ctrl c called?

682


Write a program to identify if a given binary tree is balanced or not.

786


What are near, far and huge pointers?

743


What does the c preprocessor do?

723


c language interview questions & answer

1564


What is a constant and types of constants in c?

695


What is static memory allocation?

716


What is difference between constant pointer and constant variable?

741


How can this be legal c?

738


What is difference between structure and union in c?

633