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 / ruchi
#include<stdio.h>
#include<conio.h>
int main()
{
int i=0,c;
char a[20];
printf("\nEnter the string");
while((a[i++]=getchar())!='\n');
printf("\nReverse of the string is ");
for(c=i;c>=0;c++)
{
printf("%c"a[c]);
}
getch();
}
Is This Answer Correct ? | 1 Yes | 5 No |
Post New Answer View All Answers
What is character set?
What is a constant?
What are 3 types of structures?
What is array of structure in c programming?
What is restrict keyword in c?
What is static identifier?
Write a function which takes as parameters one regular expression(only ? and * are the special characters) and a string and returns whether the string matched the regular expression.
what are the program that using a two dimensional array that list the odd numbers and even numbers separately in a given 10 inputs values
What is binary tree in c?
What is assert and when would I use it?
Write a program to print fibonacci series using recursion?
What are two dimensional arrays alternatively called as?
What is the use of define in c?
Which is the memory area not included in C program? give the reason
Why we use int main and void main?