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

Answer Posted / sr amit tyagi

#include<stdio.h>
#include<conio.h>
void main()
{
FILE *f;
char c;
clrscr();
f=fopen("string","w");
while((c=getchar())!=EOF)
{
putc(c,f);
}
fclose(f);
f=fopen("string","r");
fseek(f,-1L,2);
do
{
putchar(getc(f));
}
while(!fseek(f,-2L,1));
fclose(f);
getch();
}

Is This Answer Correct ?    0 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the benefit of using an enum rather than a #define constant?

644


any "C" function by default returns an a) int value b) float value c) char value d) a & b

656


How do I swap bytes?

620


What is the maximum no. of arguments that can be given in a command line in C.?

656


What is function prototype in c with example?

563






What are dangling pointers in c?

629


What is the advantage of c?

605


Here is a neat trick for checking whether two strings are equal

558


about c language

1590


#include #include struct stu { int i; char j; }; union uni { int i; char j; }; void main() { int j,k; clrscr(); struct stu s; j=sizeof(s); printf("%d",j); union uni u; k=sizeof(u); printf("%d",k); getch(); } what is value of j and k.

5170


What is 2c dna?

595


Do character constants represent numerical values?

832


Why do we use int main?

596


How many levels of pointers can you have?

695


How many types of sorting are there in c?

596