Answers for "input an array"

6

take array as input in c

int size=5;
int array[size]; // array of size=5;

for(i=0;i<size;i++){
   scanf("%d",&array[i]);
                }
Posted by: Guest on November-05-2020
1

take array input

arr = list(map(int, input().split()))
Posted by: Guest on August-08-2020
0

array input

BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String  lines = br.readLine();    
        
    String[] strs = lines.trim().split("\s+");
            
    for (int i = 0; i < strs.length; i++) {
    a[i] = Integer.parseInt(strs[i]);
    }
Posted by: Guest on June-14-2021

Code answers related to "input an array"

Python Answers by Framework

Browse Popular Code Answers by Language