edited by
400 views
0 votes
0 votes

IB JIO Grade-2 Tech 2023 part-2-18

Q.18 Which of the following function in python is used to read keyboard input?
Ans
1. scanf
2. input
3. gets
4. $\operatorname{cin}$
Question ID : 630680278533
Option 1 ID : 6306801082418
Option 2 ID : 6306801082417
Option 3 ID : 6306801082419
Option 4 ID : 6306801082420
Status : Answered
Chosen Option : 2

edited by

1 Answer

1 votes
1 votes

All the given functions are used in different programming languages to read the input data from the keyboard 

  1. input(): input() function can be used to read the data directly. it supports Python 3 whose return type is a string.
  2. scanf(): scanf() function can be used to read the input data in C language.
  3. cin: cin is a predefined variable that reads data from the keyboard with the extraction operator (>>).
  4. gets(): it is a predefined function in $C$ programming which is used to read strings and store the string into a string variable. gets() is terminated until a new line character is not encountered.

So option $(2)$ is correct.

Related questions

0 votes
0 votes
1 answer
2
0 votes
0 votes
0 answers
4