Horje
how to input n space separated integers in c Code Example
how to read space separated words in c
scanf("%[^\n]%*c", ref_string); 
input n space separated integers in c++
int main() {
int sum = 0;
cout << "enter number" << endl;
int i = 0;
while (true) {
    cin >> i;
    sum += i;
    //cout << i << endl;
    if (cin.peek() == '\n') {
        break;
    }
    
}

cout << "result: " << sum << endl;
return 0;
}
how to input n space separated integers in c
int main() {
    int i, n;
    scanf("%d", &n);
    int arr[n];
    for(i=0;i<n;i++)
        scanf("%d", &arr[i]);
}




C

Related
c change value of const Code Example c change value of const Code Example
pid of a process in c Code Example pid of a process in c Code Example
use isdigit in if statment c Code Example use isdigit in if statment c Code Example
how to run c program from visual studio terminal Code Example how to run c program from visual studio terminal Code Example
define constant c Code Example define constant c Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8