C program to input an array from a sequence of space-separated integers
Given a string S consisting of space-separated integers, the task is to write a C program to take the integers as input from the string S and store them in an array arr[]. Show
Examples:
Recommended: Please try your approach on {IDE} first, before moving on to the solution. Approach: The idea is to solve the given problem is to use getchar() function to check if a ‘\n’ (newline) occurs is found while taking input and then stop the input. Follow the step below to solve the given problem:
Below is the implementation of the above approach:
C
Output: Article Tags : Arrays C Programs Strings Technical Scripter c-input-output Practice Tags : Arrays Strings “how to scan an array space separated integers in c” Code Answerhow to convert n space separated integers in c++ cpp by Filthy Finch on Jun 28 2020 Comment 0 Source: discuss.codechef.com Add a Grepper Answer C++ answers related to “how to scan an array space separated integers in c”
C++ queries related to “how to scan an array space separated integers in c”
A single line contains integers separated by space885 Views 2 Comments ShareSrinivasMaddeboina 10 mons ago a=map(int,input().split()) for i in a: print(i,end=" ") its showing error in printing a single line containing l list of integers.Can anyone help me |