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...
Type: Posts; User: fred2028
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...
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", ...
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]);