How can you store values entered from keyboard in an array - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

How can you store values entered from keyboard in an array

JoashJoash KenyaPosts: 2Member

How to make grading system using values stored in an array

Comments

  • HK_MP5KPDWHK_MP5KPDW Posts: 770Member ✭✭✭

    Your post title does not match what your post body says. One implies you have trouble getting input from the user and storing the data into an array, the other implies you already have data in an array but need assistance processing it.

    That said, what values are being read/stored in the array? How should the I/O behave? What should the output look like?

  • tienkhoanguyentienkhoanguyen houPosts: 158Member

    Jesus Christ! Well, it depends on the library that is written. However, I think you can do the following code:

    include <stdio.h>

    int main() { char array[10];

    array[0] = getchar(); array[1] = getchar(); return 0; }

    Here is a complex example. You can simplify it by putting it in a loop and using another variable. However, for you to get the point easy this is probably good enough in hope.

Sign In or Register to comment.