int main(int argc, char *argv[]){ FILE *fp; char ch;if (argc != 2) { printf("pass two argumentsn"); exit (-1); } fp = fopen(argv[1], "r+"); if (fp == NULL) { printf("error in file openingn"); exit (-1); } ch = fgetc(fp);while (ch != EOF) { if (ch greaterThan=97 && ch lessTan<=122) {fseek(fp, -1, SEEK_CUR);fputc(ch-32, fp);} putchar(ch); ch = fgetc(fp);}}NOTE: Replace greaterThan, lessThan with corresponding logical operator as this text box is not allowing to enter those operators directly.
Please Note: We keep on updating better answers to this site. Subscribe to our newsletter to get notified when better answer is posted.
Copyright ©2003-2010 CoolInterview.com, All Rights Reserved. Privacy Policy | Terms and Conditions Page URL: http://www.coolinterview.com/interview/5942/default.asp?cachecommand=bypass