Doubt in question

210 views
Skip to first unread message

Rahul

unread,
Oct 5, 2020, 6:42:55 AM10/5/20
to Discussion forum for Mathematics for Data Science I
√49 is rational number
√49=7 is integer number is incorrect or correct 
please solve my doubt
Screenshot_20201005-160951.png
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

Christopher Raphael

unread,
Oct 6, 2020, 3:24:42 AM10/6/20
to Discussion forum for Mathematics for Data Science I
The unmodified list will have "6 counts" of "integer", since the question asks one to count the number of integers in the list. (did not ask for unique integers' count)

Christopher Raphael

unread,
Oct 6, 2020, 4:14:54 AM10/6/20
to Discussion forum for Mathematics for Data Science I
let listOfReals = [ √3, 2.5, e, √49, 7, 22, pi, -35, √6, 1729, -20000 ];
let numberOfElementsInList = listOfReals.length; //=>length of the array = 11
let integerCount=0;

for(i=0; i<numberOfElementsInList; i++)
 {
  if(listOfReals[i]==INTEGER)
   {
   integerCount++;
   }
 }

Result> integerCount: 6
Because √49=7 and therefore will be counted as an integer.


On Monday, 5 October 2020 16:12:55 UTC+5:30, Rahul wrote:

Venkatesan Shesha Srikanth

unread,
Oct 6, 2020, 7:28:47 AM10/6/20
to Discussion forum for Mathematics for Data Science I
Hi,
    You are right, there are 6 integers in the given list. But now, we have corrected the list. Thank you
Warm regards
srikanth venkatesan
IITM Online degree project
3rd floor, IC&SR building, IIT Madras.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages