I'm new in C programming language.
I need to get every digit separately that user have entered.
Here is my code:
#include <stdio.h>
int main()
{
int n[100];
printf("Enter a number: ");
scanf("%d",&n);
printf("%d %d %d",n[1],n[2],n[3]);
return 0;
} //i know that my code is not assigning like i want.
and now for example user entered a number like 123, i want the output like 1 2 3,
How can i assign every digit to n[i] ?
Without using string to int or int to string like atoi?
Here is what Im going to do:
User will enter a number and the program will search from Matrix 100x100 in row or column. i think i need to get the every digit separately to search.
getcharfunction.