Wednesday, 23 April 2014

33. Modify the program no: 23 using file concept.



#include<stdio.h>
#include<conio.h> main()
{
char *str; int len,i; FILE *fp; clrscr();
fp=fopen("vim","r");
fscanf(fp,"%s",str); len=strlen(str); for(i=len-1;i>=0;i--)
printf("%c",*(str+i)); getch();
return 0;
}
Output: emoclew

No comments:

Post a Comment