C program to Read From a File

#include <stdio.h>
#include <stdlib.h>
void main()
{
    FILE *fptr;
    char filename[15];
    char ch;
    printf("Enter the filename to be opened \n");
    scanf("%s", filename);
    /*  open the file for reading */
    fptr = fopen(filename, "r");
    if (fptr == NULL)
    {
        printf("Cannot open file \n");
        exit(0);
    }
    ch = fgetc(fptr);
    while (ch != EOF)
    {
        printf ("%c", ch);
        ch = fgetc(fptr);
    }
    fclose(fptr);
}

Reactions:

39 comments:

  1. This comment has been removed by a blog administrator.

    ReplyDelete
  2. This comment has been removed by a blog administrator.

    ReplyDelete
  3. its all up to you

    ReplyDelete
  4. This comment has been removed by a blog administrator.

    ReplyDelete
  5. 7 ways to be a better programmer:
    1.Check Your Code First Before Looking to Blame Others
    2.Continuous Learning
    3.Don’t Be Afraid to Break Things
    4.The Professional Programmer
    5.Take Advantage of Code Analysis Tools
    6.Ubuntu Coding for Your Friends
    7.You Gotta Care About the Code

    ReplyDelete
  6. http://download-16-cs.blogspot.ro

    ReplyDelete
  7. The government should be blamed for not taking actions against the government schools which have fail to give quality education. On the other hand we get higher education from private schools but we have to pay a lot for it.
    Pakistan Education News

    ReplyDelete
  8. Great blog posts, it really like to reading of this best education from with private school. Thanks for shared it, Oswaal Books

    ReplyDelete

  9. this is really a very great blog. the information present in this blog will be very useful for us. thank you for sharing with us.
    SEO Company In Chennai

    ReplyDelete
  10. Very Nice Blog I Have Read Your Blog It Is Very Interesting And useful For Computer Science Projects Thank You For Posting and Sharing With Us And Please Give Me More Information About Computer Projects
    final year project for computer science.

    ReplyDelete
  11. Such a great articles in my carrier, It's wonderful commands like easiest understand words of knowledge in information's.

    Hadoop Training in Chennai

    ReplyDelete
  12. Cat6 Cable Manufacturers Supplier

    We have gained a huge popularity in the market by offering excellent quality assortment of Cat6 Cable Manufacturers Supplier. These are manufactured from high grade raw materials and latest technology by our expert team. Best quality and low prices we are supplier. Call us +91 98990 00668.

    mandeepcables.com/cat-6-product-770606.html

    ReplyDelete

  13. नोटबंदी के 50वें दिन, मोदी सरकार के फैसले से निराश हैं जनता
    Readmore todaynews18.com https://goo.gl/NJUQY9

    ReplyDelete
  14. Great post! I am actually getting ready to across this information, It's very helpful for this blog.Also great with all of the valuable information you have Keep up the good work you are doing well.

    AWS Training in Chennai

    ReplyDelete
  15. Wonderful bloggers like yourself who would positively reply encouraged me to be more open and engaging in commenting.So know it's helpful.
    New Zealand Education Consultants in Chennai

    ReplyDelete
  16. This comment has been removed by the author.

    ReplyDelete
  17. There are lots of information about latest technology and how to get trained in them, like this have spread around the web, but this is a unique one according to me. The strategy you have updated here will make me to get trained in future technologies. By the way you are running a great blog. Thanks for sharing this.

    Painless Dental Treatment In Chennai

    Best Dental Clinic In Adyar

    ReplyDelete
  18. Hi Dear,

    I see your blog daily. your blog is very useful for me & i like so much..


    chemistry tuition - Best Award Winning Tuition Centre since 1999, helping students achieve OUTSTANDING results. Effective methodologies for PSLE, Secondary, O, A Level, JC H2 tuition
    Visit : http://www.smartlab.com.sg/Tuition

    ReplyDelete
  19. Superb. I really enjoyed very much with this article here. Really it is an amazing article I had ever read. I hope it will help a lot for all. Thank you so much for this amazing posts and please keep update like this excellent article.thank you for sharing such a great blog with us. expecting for your.

    iOS App Development Company

    ReplyDelete
  20. Hello Guy
    Do you want to play game in casino online
    Please Click Here now
    thank you
    จีคลับ
    บอลออนไลน
    gclub online

    ReplyDelete

  21. Being new to the blogging world I feel like there is still so much to learn. Your tips helped to clarify a few things for me as well as giving..
    Android App Development Company

    ReplyDelete
  22. great and nice blog thanks sharing..I just want to say that all the information you have given here is awesome...Thank you very much for this one.
    web design Company
    web development Company
    web design Company in chennai
    web development Company in chennai
    web design Company in India
    web development Company in India

    ReplyDelete
  23. The content of your blog is exactly what I needed, I like your blog, I sincerely hope that your blog a rapid increase in traffic density, which help promote your blog

    and we hope that your blog is being updated.

    Financial Management Assignment

    ReplyDelete
  24. virtual accountant is the best way to opt for an assistant without any issues. The virtual accounting services helps in keeping a track of the accounts. Visit our website to know more about us. marhabareception.com

    ReplyDelete

  25. I wondered upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I’ll be subscribing to your

    feed and I hope you post again soon.
    iOS App Development Company
    iOS App Development Company

    ReplyDelete
  26. Being new to the blogging world I feel like there is still so much to learn. Your tips helped to clarify a few things for me as well as giving..
    Fitness SMS
    Salon SMS
    Investor Relation SMS

    ReplyDelete
  27. it is really amazing...thanks for sharing....provide more useful information...
    Mobile app development company

    ReplyDelete
  28. I have been surfing the internet for the past two hours The Importance of Research Editing Services and I have not come across such an interesting and magnificent site. It not only has a unique design but also great content that resonates with the audience. I will, therefore, not mind visiting this site occasionally to read both old and new articles.

    ReplyDelete
  29. This article is very much helpful and i hope this will be an useful information for the needed one. Keep on updating these kinds of informative things...
    Fitness SMS
    Fitness Text
    Salon SMS
    Salon Text
    Investor Relation SMS
    Investor Relation Text

    ReplyDelete
  30. great and nice blog thanks sharing..I just want to say that all the information you have given here is awesome...Thank you very much for this one.
    web design Company
    web development Company
    web design Company in chennai
    web development Company in chennai
    web design Company in India
    web development Company in India

    ReplyDelete
  31. Free easy & simple way to learn programming online we provide niit projects, assignments, cycle tests and much more..
    visit===>> http://foundjava.blogspot.in/

    ReplyDelete