write a program in reverse the string without using
pointer,array,global variable declaration,lib fun only using
a function?

Answer Posted / sanjay

#include<stdio.h>
int main()
{
char a[10],b[10];
int i,c=0;
printf("Enter string");
scanf("%s",a);
for(i=0;a[i]!='\0';i++)
{
c=c+1;
}
for(i=c-1;i>=0;i--)
{
b[j]=a[i];
j++;
}
b[j]='\0';

printf("Reverse the string %s",b);
return 0;
}

Is This Answer Correct ?    6 Yes 11 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

List at least 10 sorting methods indicating their average case complexity, worst case complexity and best case complexity.

2303


what is the differnce between programing langauge and tool? is sas is a programing langauge r tool?

1906


What is the meaning of && in c?

550


What is getch?

633


typedef enum { html, java, javascript, perl, cgi } lang;The above statement defines a : a) Union b) User defined type c) Enumerated variable d) none

716






What is 1f in c?

1839


What are the types of data files?

729


What is the difference between formatted&unformatted i/o functions?

617


What should malloc() do? Return a null pointer or a pointer to 0 bytes?

625


How can variables be characterized?

1652


How can I invoke another program or command and trap its output?

617


if p is a string contained in a string?

1404


When should volatile modifier be used?

556


What is the c value paradox and how is it explained?

575


Explain the difference between malloc() and calloc() in c?

578