This semester is my first programming class and I am really struggling to complete this project. I just can't get a handle on this.I know its simple but my program is not running. Can someone help me and explain it ?
Here are the rules(outline):
- You must ask the user to enter the initial value (Hint: into an array of chars)
- You must be able to handle numbers at least up to 20 digits long. Notice that this is bigger than an integer variable can hold (hence the need for arrays)
- You must use arrays to manipulate the digits (Hint: you know how to reverse arrays)
i don't really know what what to do after this.
My Code:
#include <stdio.h>
int main()
{
//2.You must be able to handle numbers at least up to 20 digits long. Notice that this is bigger than an integer variable can hold (hence the need for arrays)
char a[21] = ""; //Define an empty string
char val;
//1.You must ask the user to enter the initial value (Hint: into an array of chars)
printf("Please enter a value for the element: ");
scanf("%d", &val);
return 0;
}