Hello again, So from what you told me the strings in the char storage are always seen as two.For example because the program wanted a single character the storage was set to two because of the trailing 0 afterwords. Though in reality they are only 1 digit, is that correct?
Anyways, my new question is how would this be applied with an odd number and for what reason is 5 set for char storage? I listed the code below. I apologize for bothering you with all these questions. If you know of a website that would provide me with all the info that I would need to know about this, I would appreciate it. thanks.
Code:
#include <stdio.h>
#include <stdlib.h>
int main()
{
int tax1,tax2;
char height[4],temp[4],favnum[5];
printf("Enter the height in inches:");
gets(height);
printf("What temperature is it outside?");
gets(temp);
printf("Enter your favorite number:");
gets(favnum);
tax1=atoi(height)*atoi(favnum);
tax2=atoi(temp)*atoi(favnum);
if(tax1>tax2)
{
printf("You owe $%d in taxes.\n",tax1*10);
}
if(tax2>=tax1)
{
printf("You owe $%d in taxes.\n",tax2*10);
}
return(0);
}