Problem 90: Paragraph

Create a text file in your computer and write a paragraph about INTERNET on that file. Then write a program which will open that file and print the whole paragraph into console.

2,845 total views, 2 views today

Comments

comments

One thought on “Problem 90: Paragraph”

  1. #include
    int main()
    {
    char paragraph[1000];
    FILE * fp;
    fp = fopen(“paragraph.txt”,”w”);
    scanf(” %[^\n]”,paragraph);
    fprintf(fp,”%s”,paragraph);
    fclose(fp);

    fp = fopen(“paragraph.txt”,”r”);
    fscanf(fp,” %[^\n]”,paragraph);
    printf(“%s”,paragraph);
    fclose(fp);
    return 0;
    }

Leave a Reply

Your email address will not be published.