write function to reverse char array ... without using second
array
Answers were Sorted based on User's Feedback
Answer / nagesh r. dalave
void main()
{
char strp20];
int len=0,i=0;
printf("\nEnter a string ");
gets(str);
while(str[i]!='\0')
{
i++;
len++;
}
printf("\nReverse of given string:");
while(i>=0)
{
printf("\n %c",str[i]);
i--;
}
getch();
}
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / kiran
{
char temp;
for(i,j=strlen(str)-1;i<j;i++,j--)
{
temp = str[i];
str[i] = str[j];
str[j] = temp;
}
return str;
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / sunitha
/* function to reverse a charactor array */
void rev_array(char str[])
{
char c;
char *p;
p=str;
while(*p)
{
if(*p!='\0')
{
c=p;
}
p++;
}
printf("reverse array is %s\n",c);
}
| Is This Answer Correct ? | 1 Yes | 7 No |
What are high level languages like C and FORTRAN also known as?
any "C" function by default returns an a) int value b) float value c) char value d) a & b
which is an algorithm for sorting in a growing Lexicographic order
what is Structural oriented language? give some example of this language.....?
What is a char in c?
What is queue in c?
What are the different types of pointers used in c language?
List at least 10 sorting methods indicating their average case complexity, worst case complexity and best case complexity.
What is the difference between abs() and fabs() functions?
In C language, the variables NAME, name, and Name are all the same. TRUE or FALSE?
which of the following is not a character constant a) 'thank you' b) 'enter values of p, n ,r' c) '23.56E-o3' d) all of the above
What is the proper way of these job Tell me about there full work