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

wts EOF AND IS SCANF returen values?

Replies

  • Whats In Name
    Whats In Name
    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
  • rahul69
    rahul69
    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.😀
  • Prateek Gupta
    Prateek Gupta
    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.

You are reading an archived discussion.

Related Posts

The Indian Institutions of Engineers,SOUTH EX was established in the year 2010.the Indian institutions of engineers is a premier technical education and training institute in the SOUTH EX. This institute...
hi friends, i am trying hard to connect arduino mega adk with my android app through php server located on a web hosting site. the problem is, i want to...
How To connect the Microcontroller with our computers?? My problem is that.. "I have created One Device using micro controller which reads the Temprature.Hence i want to send that reading...
I search information about design the software and the hardware of controllers especially servo controllers.​I have several questions about this subject and I will glad if you can write your...
Prelude: The monkey Like all introductions, let me start this one with a (very) brief talk on myself. I'm Amit and right now I'm doing my M.Tech in VLSI and...