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

Is fortran still used today?

604


write a sorting prgm to sort 50 nos and sum them and also remove all the occurrences of 15 and print it?

1674


write a c programming using command line argument,demonstrate set operation(eg;union,intersection,difference) example output is c:>setop 12 34 45 1 union 34 42 66 c:>setop 12 34 1 42 66 c:>setop 12 34 diff 12 56 67 78 setop 12 34

1628


Tell me can the size of an array be declared at runtime?

599


Is a house a shell structure?

697






What is variables in c?

607


What is a protocol in c?

559


What is the default value of local and global variables in c?

559


What is the difference between #include

and #include “header file”?

552


How can I write a function that takes a format string and a variable number of arguments?

605


How can I discover how many arguments a function was actually called with?

635


Write a program to check prime number in c programming?

597


Do you have any idea how to compare array with pointer in c?

604


What is the value of a[3] if integer a[] = {5,4,3,2,1}?

671


What is the right type to use for boolean values in c? Is there a standard type? Should I use #defines or enums for the true and false values?

608