pgm to reverse string using arrays i.e god is love becomes
love is god)
(assumption:only space is used for seperation of words)
no addtional memory used.i.e no temporary arrays can used.
Answer Posted / paaru
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char a[20],i;
printf("\n\nEnter the string:");
gets(a);
for(i=strlen(a)-1;i>=0;i++)
{
printf("%d"a[i]);
}
getch();
}
| Is This Answer Correct ? | 1 Yes | 7 No |
Post New Answer View All Answers
What are header files in c programming?
What is multidimensional arrays
#include main() { enum _tag{ left=10, right, front=100, back}; printf("left is %d, right is %d, front is %d, back is %d",left,right,front,back); }
What is the total generic pointer type?
Write a program to print ASCII code for a given digit.
What is difference between %d and %i in c?
Write a C program that will accept a hexadecimal number as input and then display a menu that will permit any of the following operations to be carried out: Display the hexadecimal equivalent of the one's complement. (b) Carry out a masking operation and then display the hexadecimal equivalent of the result. (c) Carry out a bit shifting operation and then display the hexadecimal equivalent of the result. (d) Exit. If the masking operation is selected, prompt the user lor the type of operation (bitwise and, bitwise exclusive or, or bitwise or) and then a (hexadecimal) value for the mask. If the bit shifting operation is selected. prompt the user for the type of shift (left or right), and then the number of bits. Test the program with several different (hexadecimal) input values of your own choice.
"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above
In C language, a variable name cannot contain?
int far *near * p; means
where are auto variables stored? What are the characteristics of an auto variable?
What are the scope of static variables?
In c programming, explain how do you insert quote characters (? And ?) Into the output screen?
Is it possible to pass an entire structure to functions?
What could possibly be the problem if a valid function name such as tolower() is being reported by the C compiler as undefined?