Search:

Type: Posts; User: fred2028

Search: Search took 0.00 seconds.

  1. Assigning digits to cells in an integer array

    So say that I have the number 1234567 taken from the user with scanf. How can I store EACH DIGIT of this number into its own cell in an array? My code is as below, and I wanna modify it so that you...
  2. Replies
    7
    Views
    1,495

    Well from what I've learned in class float is a...

    Well from what I've learned in class float is a decimal number ...
    And I've tried using int, same problem. It always prints out the number "2", ...
  3. Replies
    7
    Views
    1,495

    Why can't I read an int in an array?

    OK, so this is my code

    #include <stdio.h>
    #include <stdlib.h>
    int main() {
    int number[21];

    printf("Hi ");
    scanf("%d", &number);
    printf("%d", number[1]);
Results 1 to 3 of 3