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
write a program to generate address labels using structures?
Tell me what are bitwise shift operators?
What does typedef struct mean?
What is malloc() function?
Explain what is the stack?
Calculate 1*2*3*____*n using recursive function??
Explain what is the difference between far and near ?
What is cohesion in c?
What are the different types of objects used in c?
What is the usage of the pointer in c?
What does stand for?
explain what are actual arguments?
What is hashing in c language?
An organised method of depicting the use of an area of computer memory used to signify the uses for different parts of the memory a) swap b) extended memory c) memory map d) all of the above
Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal. [ I gave the obvious solution of taking % 10 and / 10, which gives us the decimal value in reverse order. This requires an array since we need to print it out in the correct order. The interviewer wasn't too pleased and asked me to give a solution which didn't need the array ].