Initialize an array with user input in C ➡️

preview_player
Показать описание
#coding #programming #cprogramming

This video demonstrates how to add values into an array using C for a beginner
Рекомендации по теме
Комментарии
Автор

#include <stdio.h>

int main() {

int scores[5] = {0};

for(int i = 0; i < 5; i++){
printf("Enter a score: ");
scanf("%d", &scores[i]);
}

for(int i = 0; i < 5; i++){
printf("%d ", scores[i]);
}

return 0;
}

BroCodez
Автор

Dude what you are doing is freakin awesome. Valuable, easy-to-understand, FREE information on multiple different programming languages, and every video is a fundraiser for St. Jude! I really appreciate what you do man, and these resources are gonna be super helpful for my and other people's programming journeys. Keep it up, Christ's peace be with you !

reignellwalker
Автор

can you make a playlist on DSA it would be really helpful . Thanks!

ailesh
Автор

What if I want to fill the array with single line inputs separated with space?
for example in python I would simply write:
Mylist = map(int, input().split())
What is the code or function for that in C?

arminservati
welcome to shbcf.ru