CrazyEngineers
  • What is - while(scanf("%d %d",&n,&m)!=EOF) ?

    lit-857

    Member

    Updated: Oct 26, 2024
    Views: 1.1K
    wts EOF AND IS SCANF returen values?
    0
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • Whats In Name

    MemberApr 11, 2013

    scanf returns the number of items assigned,EOF means end-of-file and has value -1,so this statement probably means run the loop 2 times.

    *Please correct me,if I am wrong
    Are you sure? This action cannot be undone.
    Cancel
  • rahul69

    MemberApr 11, 2013

    lit-857
    wts EOF AND IS SCANF returen values?
    This statement simply means keep on scanning the values of m and n until End of File is reached.
    Scanf returns number of variables scanned normally but it returns EOF if End of File is reached before variables could be scanned.😀
    Are you sure? This action cannot be undone.
    Cancel
  • Prateek Gupta

    MemberApr 17, 2013

    scanf :- used to scan the values.
    EOF:- indicates the End Of File.
    != :- relational operator (not equal to)
    this can be understood like this :-
    keep scanning the values in variables n and m from the file until EOF has not been found.
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register